Commit 1bc072e96dd259513368bf2885d7c8e2933a417e
1 parent
ebe1e165
Exists in
master
and in
1 other branch
Ignora remoção da vírgula quando a classificação for 'NUM' e não converte número…
… por extenso quando tiver apenas a escala
Showing
2 changed files
with
5 additions
and
0 deletions
Show diff stats
src/ConverteExtenso.py
@@ -90,6 +90,8 @@ o resultado. | @@ -90,6 +90,8 @@ o resultado. | ||
90 | def convert_extenso(extenso): | 90 | def convert_extenso(extenso): |
91 | global newToken, auxToken | 91 | global newToken, auxToken |
92 | extensoQuebrado = extenso.lower().split(" ") | 92 | extensoQuebrado = extenso.lower().split(" ") |
93 | + if len(extensoQuebrado) == 1 and und.has_key(simplifica(extensoQuebrado[0])): | ||
94 | + return extenso | ||
93 | nums = [] | 95 | nums = [] |
94 | it = Iterator() | 96 | it = Iterator() |
95 | it.load(extensoQuebrado) | 97 | it.load(extensoQuebrado) |
src/alexp.py
@@ -59,6 +59,9 @@ def etiquetaSentenca(s): | @@ -59,6 +59,9 @@ def etiquetaSentenca(s): | ||
59 | anotada_corrigida = [] | 59 | anotada_corrigida = [] |
60 | for x in anotada: | 60 | for x in anotada: |
61 | if x[1] not in tag_punctuation: | 61 | if x[1] not in tag_punctuation: |
62 | + if x[1] == "NUM": | ||
63 | + anotada_corrigida.append(x) | ||
64 | + continue | ||
62 | tupla = [regex.sub('',x[0]).lower(),x[1]] | 65 | tupla = [regex.sub('',x[0]).lower(),x[1]] |
63 | if tupla[0] != "": anotada_corrigida.append(tupla) | 66 | if tupla[0] != "": anotada_corrigida.append(tupla) |
64 | return anotada_corrigida | 67 | return anotada_corrigida |