a-v-bely
commited on
Commit
·
f967bcc
1
Parent(s):
abaf342
Update app.py
Browse files
app.py
CHANGED
|
@@ -95,6 +95,8 @@ def annotate_morphemes(word, prefixes=prefixes, suffixes=suffixes):
|
|
| 95 |
annotation.append({stack[::-1]: 'root'})
|
| 96 |
elif annotation and list(annotation[-1].values())[0] in ('ending', 'suffix', 'interfix', 'root'):
|
| 97 |
annotation.append({stack[::-1]: 'root'})
|
|
|
|
|
|
|
| 98 |
else:
|
| 99 |
annotation.append({stack[::-1]: 'unknown'})
|
| 100 |
return [list(x.items())[0] for x in annotation[::-1]]
|
|
|
|
| 95 |
annotation.append({stack[::-1]: 'root'})
|
| 96 |
elif annotation and list(annotation[-1].values())[0] in ('ending', 'suffix', 'interfix', 'root'):
|
| 97 |
annotation.append({stack[::-1]: 'root'})
|
| 98 |
+
elif not annotation:
|
| 99 |
+
annotation.append({stack[::-1]: 'root'})
|
| 100 |
else:
|
| 101 |
annotation.append({stack[::-1]: 'unknown'})
|
| 102 |
return [list(x.items())[0] for x in annotation[::-1]]
|