Skip to content

Commit

Permalink
Update - Regex NOmeacao efetiva
Browse files Browse the repository at this point in the history
- Changed rule_for_inst regex in efetivos_nome
- Fixed test_extract_polished_acts
  • Loading branch information
Lary15 committed Nov 2, 2021
1 parent 26f8d8c commit 0a2074c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dodfminer/extract/polished/acts/nomeacao.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def _props_names(self):

def _rule_for_inst(self):
start = r"(NOMEAR\s)"
body = r"((?:[ao]s\scandidat[ao]s\sabaixo(?:([a-zA-Z_0-9,\s\/-\:\-\(\);](no?\.)?)*).|(?:[ao]\scandidat[oa]\sabaixo(?:[a-zA-Z_0-9,\s\/-\:\-\(\);]*)))(?:\s[a-zA-Z_\s]*(?:deficiencia|especiais):(?:\s[\sA-Zo]+,\s?\d{1,4}o?;?)+)?(?:\s)?(?:[\r\n\t\f\sa-zA-Z_\s]*classificacao:(?:\s[\sA-Zo]+,\s?\d{1,4}o?[,;]?)+)?)"
body = r"((?:[ao]s\scandidat[ao]s\sabaixo(?:([a-zA-Z_0-9,\s\/-\:\-\(\);](no?\.)?)*).|(?:[ao]\scandidat[oa]\sabaixo(?:([a-zA-Z_0-9,\s\/-\:\-\(\);](no?\.)?)*)))(?:\s[a-zA-Z_\s]*(?:deficiencia|especiais):(?:\s[\sA-Zo]+,\s?\d{1,4}o?;?)+)?(?:\s)?(?:[\r\n\t\f\sa-zA-Z_\s]*classificacao:(?:\s[\sA-Zo]+,\s?\d{1,4}o?[,;]?)+)?)"
end = ""
return start + body + end

Expand Down
8 changes: 4 additions & 4 deletions tests/test_extract_polished_acts.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def test_retirement_prop_names(act_ret):

def test_retirement_rule(act_ret):
assert act_ret._rule_for_inst(
) == r"(APOSENTAR|CONCEDER,\sAPOSENTADORIA|CONCEDER\sAPOSENTADORIA,?\s?)([\s\S]*?(?<!lei)\s(?:[0-9|\s]*" + \
) == r"(APOSENTAR[^-]|CONCEDER,\sAPOSENTADORIA|CONCEDER\sAPOSENTADORIA,?\s?)([\s\S]*?(?<!lei)\s(?:[0-9|\s]*" + \
r"?[.|-]\s?)+?[0-9|\s]*/\s?[0-9|\s]*-?\s?[0-9|\s]*[.|,])"


Expand Down Expand Up @@ -594,7 +594,7 @@ def test_nom_com_prop_names(act_nomcom):


def test_nom_com_rule(act_nomcom):
assert act_nomcom._rule_for_inst() == r"(NOMEAR)([\s\S]*?)\.\s"
assert act_nomcom._rule_for_inst() == r"(NOMEAR)([\s\S]*?)((\.\s)|(?=(EXONERAR|NOMEAR)))"


def test_nom_com_prop_rules_names(act_nomcom):
Expand Down Expand Up @@ -680,8 +680,8 @@ def test_nom_efet_prop_names(act_nom_efet):

def test_nom_efet_rule(act_nom_efet):
assert act_nom_efet._rule_for_inst(
) == r"(NOMEAR\s)((?:[ao]s\scandidat[ao]s\sabaixo(?:[a-zA-Z_0-9,\s\/-\:\-\(\);]*).|" + \
r"(?:[ao]\scandidat[oa]\sabaixo(?:[a-zA-Z_0-9,\s\/-\:\-\(\)]*)))(?:\s[a-zA-Z_\s]*(?:deficiencia|especiais):(?:\s[\sA-Zo]+" + \
) == r"(NOMEAR\s)((?:[ao]s\scandidat[ao]s\sabaixo(?:([a-zA-Z_0-9,\s\/-\:\-\(\);](no?\.)?)*).|" + \
r"(?:[ao]\scandidat[oa]\sabaixo(?:([a-zA-Z_0-9,\s\/-\:\-\(\);](no?\.)?)*)))(?:\s[a-zA-Z_\s]*(?:deficiencia|especiais):(?:\s[\sA-Zo]+" + \
r",\s?\d{1,4}o?;?)+)?(?:\s)?(?:[\r\n\t\f\sa-zA-Z_\s]*classificacao:(?:\s[\sA-Zo]+,\s?\d{1,4}o?[,;]?)+)?)"


Expand Down

0 comments on commit 0a2074c

Please sign in to comment.