Commit db55a417df171afc8ca9f803e71cfee22ca26165
1 parent
e17c8164
Exists in
master
and in
1 other branch
Corrige aplicação das regras morfológicas na árvore sintática
Showing
1 changed file
with
9 additions
and
2 deletions
Show diff stats
src/AplicaRegras.py
@@ -261,8 +261,15 @@ class AplicaRegras(object): | @@ -261,8 +261,15 @@ class AplicaRegras(object): | ||
261 | # EU FELIZ PASSADO -> EU FELIZ | 261 | # EU FELIZ PASSADO -> EU FELIZ |
262 | if morfo[i] is not None and morfo[i][1] == "NTK" and morfo[i][0]: | 262 | if morfo[i] is not None and morfo[i][1] == "NTK" and morfo[i][0]: |
263 | new_node = self.gerar_no(morfo[i]) | 263 | new_node = self.gerar_no(morfo[i]) |
264 | - arvore[lista_pos_arv[i-1][:-3]].insert(2, new_node) | ||
265 | - #arvore[lista_pos_arv[i-1][:-2]].insert(2, new_node) | 264 | + |
265 | + #arvore[lista_pos_arv[i-1][:-3]].insert(2, new_node) | ||
266 | + #arvore[lista_pos_arv[i-1][:-3]].insert(2, new_node) | ||
267 | + | ||
268 | + if str(arvore[lista_pos_arv[i-1][:-3]]).count('(') > 7: | ||
269 | + arvore[lista_pos_arv[i-1][:-2]].insert(2, new_node) | ||
270 | + else: | ||
271 | + arvore[lista_pos_arv[i-1][:-3]].insert(2, new_node) | ||
272 | + | ||
266 | try: | 273 | try: |
267 | lista_pos_arv.insert(i,lista_pos_arv[i]) | 274 | lista_pos_arv.insert(i,lista_pos_arv[i]) |
268 | except: | 275 | except: |