Kuna is a software suite for parsing Toaq Delta. It can translate Toaq into box diagrams, syntax trees, logic formulas, and more. The word kuna /ˈkʰuːna/ is Toaq for "sentence."
You can play with the web interface here.
In the Interactive tab, you can write Toaq text, then click any of the buttons to run Kuna in one of its many modes.
In the Sentences tab, you can explore a corpus of test sentences, and see which ones are accepted by Kuna. This is a sort of "to-do list" for Kuna developers.
There is also a kuna bot on the
Toaq Discord server. Type /
to see the available
commands. It even has a few minigames!
You can check out this repository using git (or download a zip file from GitHub) and run the code on your computer using Node.js and pnpm.
For proper PNG rendering, install Noto Sans Math.
To run as a web app (at http://localhost:5173/), run these commands in a terminal:
pnpm install
pnpm run web -- --port 5173
To run as a CLI app:
pnpm install
pnpm run cli
# e.g.
pnpm run cli -- tree-text --sentence "Jaı jí"
To run as a Discord bot:
export KUNA_CLIENT_ID=your.discord.client.id
export KUNA_TOKEN=your.discord.bot.token
pnpm install
pnpm run bot
- The input text is tokenized by
src/morphology/tokenize.ts
. - The token stream is parsed by a context-free grammar for surface-level Toaq,
defined in
src/toaq.kuna.ne
. - A
logical form
tree is recovered by
src/syntax/recover.ts
. This involves undoing syntactic movement and adding scope information to the tree. - This tree can be interpreted/denoted by the code in
src/semantics
to produce a semantic representation (formula). - The various modules in
src/modes
can transform, annotate, consume, or display these results.
pnpm run data:build
downloads all English definitions from Toadua and guesses glosses and frames, storing the result indata/toadua/toadua.json
.- The result is checked into version control for convenience, but we can run this every once in a while to teach Kuna new words.
pnpm run codegen
convertssrc/toaq.kuna.ne
tosrc/toaq.ne
. This runs automatically afterpnpm install
.