Spaces:
Runtime error
Runtime error
TIMAX-159
commited on
Commit
·
0cc0438
1
Parent(s):
8590e59
readme
Browse files
README.md
CHANGED
|
@@ -6,7 +6,51 @@ colorTo: gray
|
|
| 6 |
sdk: gradio
|
| 7 |
sdk_version: 3.0.17
|
| 8 |
app_file: app.py
|
| 9 |
-
pinned:
|
| 10 |
---
|
| 11 |
|
| 12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
sdk: gradio
|
| 7 |
sdk_version: 3.0.17
|
| 8 |
app_file: app.py
|
| 9 |
+
pinned: true
|
| 10 |
---
|
| 11 |
|
| 12 |
+
## :hand: Intro
|
| 13 |
+
|
| 14 |
+
This is a simple string replacement program dedicated for typing logic symbols. Since those symbols are not on our keyboard, typing them is a little bit cumbersome. This tool allows you to type English to get them. Have fun!
|
| 15 |
+
|
| 16 |
+
> Permalink: https://huggingface.co/spaces/TIMAX/Logic-Translator
|
| 17 |
+
|
| 18 |
+
## :information_source: Usage
|
| 19 |
+
|
| 20 |
+
Input your FOL sentence in the box of **string**. If you want to type a specific logic symbol at some point of your FOL sentence, just type its corresponding tag (uppercase English words) instead, and keep everything else the same.
|
| 21 |
+
|
| 22 |
+
| Logic Symbol | Tag |
|
| 23 |
+
| :----------: | :---: |
|
| 24 |
+
| ∧ | AND |
|
| 25 |
+
| ∨ | OR |
|
| 26 |
+
| ¬ | NOT |
|
| 27 |
+
| ⊕ | XR |
|
| 28 |
+
| → | IMPLY |
|
| 29 |
+
| ↔ | EQUIV |
|
| 30 |
+
| ∀ | ALL |
|
| 31 |
+
| ∃ | EXIST |
|
| 32 |
+
|
| 33 |
+
The translation is **real-time**. After your input is finished, you can directly copy the result in the box of **output**.
|
| 34 |
+
|
| 35 |
+
You can find five examples of using them below the boxes.
|
| 36 |
+
|
| 37 |
+
## :scroll: Source Code
|
| 38 |
+
|
| 39 |
+
Very simple. The core of it is just like:
|
| 40 |
+
|
| 41 |
+
```python
|
| 42 |
+
def logic(string: str):
|
| 43 |
+
for word, symbol in logic_dict.items():
|
| 44 |
+
string = string.replace(word, symbol)
|
| 45 |
+
return string
|
| 46 |
+
```
|
| 47 |
+
|
| 48 |
+
where `logic_dict` stores all the translation between tags and logic symbols. The user interface is built with [Gradio](https://gradio.app/).
|
| 49 |
+
|
| 50 |
+
## :warning:Notice
|
| 51 |
+
|
| 52 |
+
Please don’t include the ==exact same uppercase spelling== of any of the tags in your FOL sentence if you don’t mean it, or the program will replace them without thinking. For example, it your input sentence is: **WALL(berlin wall)** meaning “berlin wall is a wall”, the program output would be **W∀(berlin wall)** with the **ALL** after **W** replaced by **∀**, which is not what you want.
|
| 53 |
+
|
| 54 |
+
## :email: Contact
|
| 55 |
+
|
| 56 |
+
If you notice any problem or have any suggestion, please contact me through [E-mail](mailto:[email protected]) or Slack. Thanks!
|