Skip to content

chippytech/lojbantrans

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lojbantrans: Proof-of-concept Lojban translator

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.

Documentation

  • --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

🚀 How to Use

1. Install dependencies

pip install -r requirements.txt

And also this for downloading the spaCy model.

spacy download en_core_web_lg

2. Run the tool

python app.py --text "Your English text here"

Use --reverse to translate from Lojban to English:

python app.py --text "coi" --reverse

Or translate from a file:

python app.py --file input.txt --save output.txt

💡 Example

python app.py --text "Cats are small mammals"

Output:

Lojban Translation:
u'i lo mlatu cmalu mabru cu zasti

📂 Project Files

  • app.py – Main CLI script
  • valsi_glosswords.json – Glossword-to-Lojban dictionary (required)

⚙️ Features

  • ✅ 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

🧠 Notes

  • 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.

🌱 Future Features

  • Grammar-aware parsing with tools like camxes or jbofihe
  • Attitudinal customization (--attitude) for expressive tone

About

PoC lojban translator

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages