Skip to content

Instantly share code, notes, and snippets.

@Fef0
Created September 10, 2022 13:57
Show Gist options
  • Save Fef0/913caa8498d8c1eca90ed1eb9d0f11e7 to your computer and use it in GitHub Desktop.
Save Fef0/913caa8498d8c1eca90ed1eb9d0f11e7 to your computer and use it in GitHub Desktop.
Convert a .mobi dictionary (Wordnet3 Infused in this example) to a StarDict .dict file (with it's .ifo)

After a whole day of struggles, I finally managed to convert a wordnet3 infused dictionary (that you can get here: http://eb.lv/) from .mobi format to .dict format (suitable for KOReader).

I tested this process on Arch Linux, so your process might be different from mine.

Step 1

  • Download the KindleUnpack program from here: https://github.com/kevinhendricks/KindleUnpack
  • Extract the .zip
  • Start the GUI with python 2 (IMPORTANT: python3 doesn't work!): python2 KindleUnpack.pyw
  • Select the .mobi file as input and choose your output directory
  • (optional) I don't know if it is necessary, but select ePub Output type: Auto-Detect
  • Click the Start button and wait
  • A file called book.html is now present in the output directory

Step 2

  • Download the mobi2stardict.py script from here: https://github.com/anezih/mobi2stardict
  • Place the script in the same folder as the book.html file
  • Run it with python (I used python3): python mobi2stardict.py --fix-links --dict-name wordnet3
  • A file called book.gls is now present in the same directory as the mobi2stardict.py script

Step 3

  • Download stardict-editor (it is packaged with other stardict tools)
  • Open a terminal and type: stardict-editor
  • A GUI should now be opened, go to "Compile" tab and click on "Browse" to select your book.gls file
  • Select "Babylon file" from the drop-down menu in the bottom of the editor and press "Compile"
  • A few files called book.dict, book.idx, book.ifo and book.syn should now be present in the same folder
  • (optional) If you want to change the dictionary name (it is book by default) then open book.ifo with a text editor and update "bookname" entry to bookname=wordnet3

Step 4 (optional, KOReader on Kindle)

  • Copy ALL the files (book.dict, book.idx, book.ifo, book.syn) to koreader/data/dict/
  • Restart KOReader
  • From KOReader select the magnifying glass > Dictionary settings > Manage dictionaries > and select wordnet3
@ranvotu
Copy link

ranvotu commented Aug 11, 2025

Could you pls share the file. Thx u.

@Fef0
Copy link
Author

Fef0 commented Aug 13, 2025

Could you pls share the file. Thx u.

Hi @ranvotu, sorry, I don't have the files anymore nor my old kindle, but the process should be pretty straightforward. I used the WordNet3 Infused English to Italian, so be sure to choose the one that is appropriate for your language.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment