diff --git a/src/AplicaRegras.py b/src/AplicaRegras.py index dcb9033..afadab4 100644 --- a/src/AplicaRegras.py +++ b/src/AplicaRegras.py @@ -384,28 +384,28 @@ class AplicaRegras(object): singular = self.analisar_plural(it.get_word()) lista_simplificada[it.get_count()][0] = singular - #if num: - # return self.converter_extenso(lista_simplificada) + if num: + return self.converter_extenso(lista_simplificada) return lista_simplificada # Alterar uma palavra do plural para o singular def analisar_plural(self, token): - if(token[-3:] == "OES" or token[-2:] == "AES" or token[-2:] == "AOS"): - return token[0:-3]+"AO" - elif(token[-3:] == "RES" or token[-2:] == "ZES" or token[-2:] == "NES"): + if(token[-3:] == "oes" or token[-2:] == "aes" or token[-2:] == "aos"): + return token[0:-3]+"ao" + elif(token[-3:] == "res" or token[-2:] == "zes" or token[-2:] == "nes"): return token[0:-2] - elif(token[-3:] == "SES"): + elif(token[-3:] == "ses"): #TODO: Algumas palavras possuem marcações gráficas na raiz singular. Ex: Gás – Gases return token[0:-2] - elif(token[-2:] == "NS"): - return token[0:-2]+"M" - elif(token[-3:] == "EIS"): - return token[0:-3]+"IL" - elif(token[-2:] == "IS"): - if(token[-3] == "A" or token[-3] == "E" or token[-3] == "O" or token[-3] == "U"): - return token[0:-2]+"L" + elif(token[-2:] == "ns"): + return token[0:-2]+"m" + elif(token[-3:] == "eis"): + return token[0:-3]+"il" + elif(token[-2:] == "is"): + if(token[-3] == "a" or token[-3] == "e" or token[-3] == "o" or token[-3] == "u"): + return token[0:-2]+"l" return token - elif(token[-1] == "S"): + elif(token[-1] == "s"): #TODO: Palavras paroxítonas ou proparoxítonas terminadas em S. Ex: lápis, vírus, tagênis, ônibus, etc return token[0:-1] else: -- libgit2 0.21.2