histlearn commited on
Commit
7cf0139
·
verified ·
1 Parent(s): 0c1fb12

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -28,7 +28,7 @@ def invert_adj_n(doc, tags):
28
  continue
29
  if doc[i].tag_ != "PUNCT":
30
  if tags[i] == "A":
31
- if i + 1 len(tags) and tags[i + 1] == "N":
32
  frase.append(doc[i + 1].text)
33
  frase.append(doc[i].text)
34
  already = True
@@ -45,7 +45,7 @@ def adjust_adj(doc, tags):
45
  for i in range(len(doc)):
46
  frase.append(doc[i].text)
47
  if tags[i] == "A":
48
- if i + 1 len(tags) and tags[i + 1] == "A":
49
  frase.append("e")
50
  return frase
51
 
@@ -58,7 +58,7 @@ def adjust_art(doc, tags):
58
  continue
59
  text = doc[i].text
60
  if tags[i] == "ART" and text.lower() == "a":
61
- if i + 1 len(doc):
62
  gender = doc[i + 1].morph.get("Gender")
63
  number = doc[i + 1].morph.get("Number")
64
  if gender and number:
 
28
  continue
29
  if doc[i].tag_ != "PUNCT":
30
  if tags[i] == "A":
31
+ if i + 1 < len(tags) and tags[i + 1] == "N":
32
  frase.append(doc[i + 1].text)
33
  frase.append(doc[i].text)
34
  already = True
 
45
  for i in range(len(doc)):
46
  frase.append(doc[i].text)
47
  if tags[i] == "A":
48
+ if i + 1 < len(tags) and tags[i + 1] == "A":
49
  frase.append("e")
50
  return frase
51
 
 
58
  continue
59
  text = doc[i].text
60
  if tags[i] == "ART" and text.lower() == "a":
61
+ if i + 1 < len(doc):
62
  gender = doc[i + 1].morph.get("Gender")
63
  number = doc[i + 1].morph.get("Number")
64
  if gender and number: