Spaces:
Runtime error
Runtime error
pip64
commited on
Commit
·
c1ba3bc
1
Parent(s):
a94f095
test
Browse files
app.py
CHANGED
|
@@ -4,9 +4,13 @@ import pymorphy3
|
|
| 4 |
morph = pymorphy3.MorphAnalyzer()
|
| 5 |
morph = pymorphy3.MorphAnalyzer(lang='ru')
|
| 6 |
|
| 7 |
-
def infinitive(
|
| 8 |
-
|
| 9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
|
| 11 |
iface = gr.Interface(fn=infinitive, inputs="text", outputs="text")
|
| 12 |
iface.launch()
|
|
|
|
| 4 |
morph = pymorphy3.MorphAnalyzer()
|
| 5 |
morph = pymorphy3.MorphAnalyzer(lang='ru')
|
| 6 |
|
| 7 |
+
def infinitive(text):
|
| 8 |
+
words = text.split()
|
| 9 |
+
newstr = ""
|
| 10 |
+
for word in words:
|
| 11 |
+
p = morph.parse(str(word))[0]
|
| 12 |
+
newstr += f"{p.normal_form}"
|
| 13 |
+
return newstr
|
| 14 |
|
| 15 |
iface = gr.Interface(fn=infinitive, inputs="text", outputs="text")
|
| 16 |
iface.launch()
|