Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -11,9 +11,16 @@ from camxes_py.camxes_py.transformers import minimal
|
|
| 11 |
parser = camxes_ilmen.Parser(None)
|
| 12 |
minimal_transformer = minimal.Transformer()
|
| 13 |
|
| 14 |
-
def
|
| 15 |
-
|
| 16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
text, node = camxes.match(lojban, parser, None, minimal_transformer, True)
|
| 18 |
|
| 19 |
if text is None:
|
|
@@ -21,5 +28,5 @@ def greet(lojban):
|
|
| 21 |
|
| 22 |
return text
|
| 23 |
|
| 24 |
-
demo = gr.Interface(fn=
|
| 25 |
demo.launch()
|
|
|
|
| 11 |
parser = camxes_ilmen.Parser(None)
|
| 12 |
minimal_transformer = minimal.Transformer()
|
| 13 |
|
| 14 |
+
def parse(lojban):
|
| 15 |
+
"""
|
| 16 |
+
Parse the Lojban text and convert it to a textual parse tree.
|
| 17 |
+
|
| 18 |
+
Args:
|
| 19 |
+
lojban: string;
|
| 20 |
+
|
| 21 |
+
Returns:
|
| 22 |
+
Tuple of (structured_lojban) where structured_lojban is the semantic structure
|
| 23 |
+
"""
|
| 24 |
text, node = camxes.match(lojban, parser, None, minimal_transformer, True)
|
| 25 |
|
| 26 |
if text is None:
|
|
|
|
| 28 |
|
| 29 |
return text
|
| 30 |
|
| 31 |
+
demo = gr.Interface(fn=parse, inputs="text", outputs="text")
|
| 32 |
demo.launch()
|