Commit b9c9d0b419920659f6fd469bc87490a376985760

Authored by Erickson Silva
1 parent 9f538d45
Exists in master and in 1 other branch devel

Adiciona lower caso o texto esteja todo em upper

Showing 1 changed file with 8 additions and 2 deletions   Show diff stats
src/PortGlosa.py
@@ -74,13 +74,19 @@ def quebrar_texto(texto): @@ -74,13 +74,19 @@ def quebrar_texto(texto):
74 sentenca = " ".join(lista_texto) 74 sentenca = " ".join(lista_texto)
75 if not sentenca[-1].isdigit(): 75 if not sentenca[-1].isdigit():
76 sentenca = sentenca[:-1]+"." 76 sentenca = sentenca[:-1]+"."
77 - sentencas.append(sentenca) 77 + sentencas.append(verificar_texto_maiusculo(sentenca))
78 lista_texto = [] 78 lista_texto = []
79 continue 79 continue
80 if lista_texto: 80 if lista_texto:
81 - sentencas.append(" ".join(lista_texto)) 81 + sentencas.append(verificar_texto_maiusculo(" ".join(lista_texto)))
82 return sentencas 82 return sentencas
83 83
  84 +def verificar_texto_maiusculo(texto):
  85 + if texto.isupper:
  86 + texto_lower = texto.lower()
  87 + return texto_lower.capitalize()
  88 + return texto
  89 +
84 def gerar_taxa_qualidade(lista_saidas): 90 def gerar_taxa_qualidade(lista_saidas):
85 soma_taxas = 0 91 soma_taxas = 0
86 quant_analise_sintatica = 0 92 quant_analise_sintatica = 0