UPDATE: We now use spaCy combined with word vectors, resulting in faster performance and more reliable translations.
lojbantrans is a Python-based proof-of-concept command-line tool for translating English text into Lojban and Lojban text into English using a glossword dictionary. It can be used standalone or as a starting point.It produces readable, Lojban-inspired output that’s great for learners and conlang explorers.
--text: The Lojban text you want to translate--verbose: The verbose mode describing each word translation in detail--file: The text file you want to import--save: The text file you want to save to--reverse: The Lojban-English translator mode
pip install -r requirements.txtAnd also this for downloading the spaCy model.
spacy download en_core_web_lgpython app.py --text "Your English text here"Use --reverse to translate from Lojban to English:
python app.py --text "coi" --reverseOr translate from a file:
python app.py --file input.txt --save output.txtpython app.py --text "Cats are small mammals"Output:
Lojban Translation:
u'i lo mlatu cmalu mabru cu zasti
app.py– Main CLI scriptvalsi_glosswords.json– Glossword-to-Lojban dictionary (required)
- ✅ Sentence splitting
- ✅ Lemmatization (handles plurals like "cats")
- ✅ Synonym fallback
- ✅ Number-to-Lojban digit conversion
- ✅ Verbose mode for debugging translations
- ✅ File input/output support
- ✅ Reverse mode (Lojban → English)
- ✅ Multi-word gloss detection
- Common English glue words like "is", "the", and "a" are ignored automatically.
- Translations follow a basic
lo ... cu ...Lojban bridi structure. - Outputs are Lojban-ish (aka Lojbish) and use valid roots, but aren't guaranteed to be grammatically perfect.
- Great for Lojban learners, conlangers, AI language tinkerers, and fans of logical languages.
- Grammar-aware parsing with tools like
camxesorjbofihe - Attitudinal customization (
--attitude) for expressive tone