TIMAX-159 commited on
Commit
a90a03e
β€’
1 Parent(s): 0821c46
Files changed (1) hide show
  1. app.py +9 -8
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
- string = string.replace(word, symbol)
19
- return string
20
 
21
 
22
  demo = gr.Interface(fn=logic,
23
  inputs="text", outputs="text",
24
  examples=[
25
- 'ALLx. Student(x) IMPLY Smart(x)',
26
- 'EXISTx. TShirt(x) AND Buy(Adam, x)',
27
- 'ALLx. (Animal(x) AND Fluffy(x)) IMPLY (Rabbit(x) OR Sheep(x))',
28
- '(GoDowntown(James) AND NOTCarry(James, Bag)) EQUIV Buy(James, Book)',
29
- 'ALLx. Project(x) IMPLY (WrittenIn(x, Python) XR WrittenIn(x, C++))'
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(share=True)
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