Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -25,15 +25,14 @@ def preprocess_text(text: str) -> typing.List[typing.List[str]]:
|
|
25 |
def fix_words(words: typing.List[str]) -> typing.List[str]:
|
26 |
fixed_words = []
|
27 |
|
28 |
-
for word, pos in tagger.tag(words):
|
29 |
-
word += pos
|
30 |
if pos[-1] == "e":
|
31 |
if word[-1] != "ِ":
|
32 |
if (word[-1] == "ه") and (word[-2] != "ا"):
|
33 |
word += "ی"
|
34 |
word += "ِ"
|
35 |
|
36 |
-
fixed_words.append(
|
37 |
|
38 |
return fixed_words
|
39 |
#return tagger.tag(words)
|
|
|
25 |
def fix_words(words: typing.List[str]) -> typing.List[str]:
|
26 |
fixed_words = []
|
27 |
|
28 |
+
for word, pos , typin in tagger.tag(words):
|
|
|
29 |
if pos[-1] == "e":
|
30 |
if word[-1] != "ِ":
|
31 |
if (word[-1] == "ه") and (word[-2] != "ا"):
|
32 |
word += "ی"
|
33 |
word += "ِ"
|
34 |
|
35 |
+
fixed_words.append(typin)
|
36 |
|
37 |
return fixed_words
|
38 |
#return tagger.tag(words)
|