Spaces:
Runtime error
Runtime error
TIMAX-159
commited on
Commit
Β·
a90a03e
1
Parent(s):
0821c46
update
Browse files
app.py
CHANGED
|
@@ -14,23 +14,24 @@ logic_dict = {
|
|
| 14 |
|
| 15 |
|
| 16 |
def logic(string: str):
|
|
|
|
| 17 |
for word, symbol in logic_dict.items():
|
| 18 |
-
|
| 19 |
-
return
|
| 20 |
|
| 21 |
|
| 22 |
demo = gr.Interface(fn=logic,
|
| 23 |
inputs="text", outputs="text",
|
| 24 |
examples=[
|
| 25 |
-
'ALLx
|
| 26 |
-
'EXISTx
|
| 27 |
-
'ALLx
|
| 28 |
-
'(GoDowntown(
|
| 29 |
-
'ALLx
|
| 30 |
],
|
| 31 |
title="Logic Translator",
|
| 32 |
description="Type English for logic symbols! \n β§:AND, β¨:OR, Β¬:NOT, β:XR, β:IMPLY, β:EQUIV, β:ALL, β:EXIST",
|
| 33 |
live=True)
|
| 34 |
|
| 35 |
-
demo.launch(
|
| 36 |
|
|
|
|
| 14 |
|
| 15 |
|
| 16 |
def logic(string: str):
|
| 17 |
+
processed_string = string
|
| 18 |
for word, symbol in logic_dict.items():
|
| 19 |
+
processed_string = processed_string.replace(word, symbol)
|
| 20 |
+
return processed_string
|
| 21 |
|
| 22 |
|
| 23 |
demo = gr.Interface(fn=logic,
|
| 24 |
inputs="text", outputs="text",
|
| 25 |
examples=[
|
| 26 |
+
'ALLx (Student(x) IMPLY Smart(x))',
|
| 27 |
+
'EXISTx (TShirt(x) AND Buy(Adam, x))',
|
| 28 |
+
'ALLx ((Animal(x) AND Fluffy(x)) IMPLY (Rabbit(x) OR Sheep(x)))',
|
| 29 |
+
'(GoDowntown(james) AND NOTCarry(james, bag)) EQUIV Buy(james, book)',
|
| 30 |
+
'ALLx (Project(x) IMPLY (WrittenIn(x, python) XR WrittenIn(x, c++)))'
|
| 31 |
],
|
| 32 |
title="Logic Translator",
|
| 33 |
description="Type English for logic symbols! \n β§:AND, β¨:OR, Β¬:NOT, β:XR, β:IMPLY, β:EQUIV, β:ALL, β:EXIST",
|
| 34 |
live=True)
|
| 35 |
|
| 36 |
+
demo.launch()
|
| 37 |
|