A compressed dictionary application for the TI-Nspire calculator using Ndless. This project provides a complete offline dictionary with efficient storage using Huffman compression. (Also, this was partially vibe-coded)
- Python 3.7+ with pip
- Wiktextract data file (wiktextract.jsonl)
- Ndless SDK (nspire-gcc toolchain)
- make utility
- Linux/WSL environment (recommended)
cd process_words
pip install -r requirements.txtDownload the English wiktextract JSONL file from Kaikki.org:
# Example: Download English wiktextract data
wget https://kaikki.org/dictionary/English/kaikki.org-dictionary-English.jsonl
mv kaikki.org-dictionary-English.jsonl process_words/wiktextract.jsonlexport WIKTEXTRACT_PATH="process_words/wiktextract.jsonl"From the main project directory:
makeThis will:
- Process the wiktextract data to generate compressed dictionary files
- Compile the C++ application for TI-Nspire
- Copy all files to the
calcbin/folder
Copy the generated files from calcbin/ to your TI-Nspire calculator.
huffman_table.csv.tns, index.csv.tns, and dictionary.bin.tns must be in the root directory of the calculator, but nDictionary.tns can be in any folder.
The dictionary uses three main files:
Binary file containing Huffman-encoded word definitions:
uint16: Size of encoded data (big-endian)uint8: Number of padding bitsbytes[]: Huffman-encoded text
CSV index for word lookups:
word,offset,size
apple,0,156
banana,156,203
...
Character encoding table:
char,code
32,101
97,001
101,11
...
- Copy files from
calcbin/to your TI-Nspire calculator. huffman_table.csv.tns, index.csv.tns, and dictionary.bin.tns must be in the root directory of the calculator. - Launch
nDictionary.tnsusing Ndless - Type a word and press Enter to search
- Use DEL key to delete characters
- Press ESC or use calculator controls to exit
Ensure the wiktextract file exists and set the environment variable:
export WIKTEXTRACT_PATH="/full/path/to/wiktextract.jsonl"Install required packages:
pip install -r process_words/requirements.txtEnsure you have the Ndless SDK properly installed and in your PATH:
which nspire-gcc # Should return a pathThis project is licensed under the MIT License. See the LICENSE file for details.
- add a lua-based GUI
- use LZ-based compression instead of Huffman
- store the index file, huffman file and dictionary file together
- allow the words' files to be stored in a subfolder alongside the app file
- add more words, and come up with a better way to filter duplicate words than pick the longest definition
- Don't load the entire index file into memory, instead use a binary search on the file directly?
- multi-threading for building the dictionary