|
1 | 1 | # Kuna
|
2 | 2 |
|
3 | 3 | Kuna is a software suite for parsing Toaq Delta. It can translate Toaq into box
|
4 |
| -diagrams, syntax trees, logic formulas, and more. |
5 |
| - |
6 |
| -The word _kuna_ /ˈkʰuːna/ is Toaq for "sentence." |
| 4 | +diagrams, syntax trees, logic formulas, and more. The word _kuna_ /ˈkʰuːna/ is |
| 5 | +Toaq for "sentence." |
7 | 6 |
|
8 | 7 | ## Using Kuna
|
9 | 8 |
|
@@ -55,3 +54,29 @@ export KUNA_TOKEN=your.discord.bot.token
|
55 | 54 | npm install
|
56 | 55 | npm run bot
|
57 | 56 | ```
|
| 57 | + |
| 58 | +## How Kuna works |
| 59 | + |
| 60 | + |
| 61 | + |
| 62 | +1. The input text is tokenized by `src/morphology/tokenize.ts`. |
| 63 | +2. The token stream is parsed by a context-free grammar for surface-level Toaq, |
| 64 | + defined in `src/toaq.kuna.ne`. |
| 65 | +3. A |
| 66 | + [logical form](https://toaqlanguage.wordpress.com/2022/09/26/logical-language-misconceptions/) |
| 67 | + tree is recovered by `src/syntax/recover.ts`. This involves undoing |
| 68 | + [syntactic movement](https://en.wikipedia.org/wiki/Syntactic_movement) and |
| 69 | + adding scope information to the tree. |
| 70 | +4. This tree can be interpreted/denoted by the code in `src/semantics` to |
| 71 | + produce a semantic representation (formula). |
| 72 | +5. The various modules in `src/modes` can transform, annotate, consume, or |
| 73 | + display these results. |
| 74 | + |
| 75 | +## Useful commands |
| 76 | + |
| 77 | +- `npm run data:build` downloads all English definitions from Toadua and guesses |
| 78 | + glosses and frames, storing the result in `data/toadua/toadua.json`. |
| 79 | + - The result is checked into version control for convenience, but we can run |
| 80 | + this every once in a while to teach Kuna new words. |
| 81 | +- `npm run codegen` converts `src/toaq.kuna.ne` to `src/toaq.ne`. This runs |
| 82 | + automatically after `npm install`. |
0 commit comments