• Config Mgmt
  • Process
  • Site Setup
  • storyboard
  • Technology
  • The Tembo Tech Mission Statement
  • Timeline
  • training

The Tembo Team Site

Tech Articles relevant to The Tembo Press

Creating a Custom Mobi Dictionary

July 13, 2020 by thetembo

So this is my first hack at trying to add a Guacuno language dictionary to my Kindle App 6.32.1 on my IoS 13.5.1. I’m working from a Windows 10 box with Python 3.6.3 already installed.

First, I had to create a dictionary of keywords on the left and definition(s) on the right separated by a tab. I did this in Open Office spreadsheet and saved it in CSV format using the other filter and the “:”, which I had used in the original document.

Addendum: I generated the spreadsheet from Polyglot. I edited the columns in a format of <part of speech> (pronunciation) definition. I wanted the part of speech as italics. It is ok to add <i>part of speech</i> as the generated code is html-based.

I’m not sure about the “:”, I generated using tab-delimited and quoted strings.

One bonus gotcha. I had strings with quotes in them. Nested quotes render as “” so I went and replaced them all with single quotes.

Second, I ran a python program called tab2opf.py obtained from [https://github.com/apeyser/tab2opf]. The readme file explains the optional parameters but suffice it to say that the source is Guacuno and the target is US English.

Addendum: If you have UTF characters, the tab2opf.py will gag on them. I found and replaced mine using Notepad++ in UTF-encoding so I could see the hex characters.

> py .\tab2opf.py -v -s Guacuno -t en-us .\GuacunoDictionary.txt

This program compiles the tab-delimited files into HTML and OPF files. These are text-based files that possibly could be further edited to make the dictionary look better, but I will wait until the dictionaries are more mature since I don’t want to be maintaining multiple files.

Third, I ran a program called “kindlegen.exe” to generate a Mobi file from the OPF file obtained from [https://www.amazon.com/gp/feature.html?ie=UTF8&docId=1000765211].

> .\kindlegen.exe .\GuacunoDictionary.opf
This creates a *.mobi file.

And finally, I mailed the dictionary Mobi file to my IoS phone and exported it from mail into the Kindle App. In my Kindle library, I had to make sure that the dictionary is actually imported into the app by tapping on it in the library. From there, you can use the app on any word in the reader by selecting a word and changing to the Guacuno dictionary.

Regrettably, I can find no way to make the selection permanent, as Kindle always resets to your install default dictionary.

Addendum: Here is the link. https://drive.google.com/file/d/1Wf0MEkQmJWf736Gd6ekNdlNS_aR6IBNq/view?usp=sharing

Posted in: tech learning Tagged: #Dictionary, #Kindle, #kindlegen, #Mobi, #OPF, #tab2opf, #windows10

Recent Posts

  • Information as Code – the New IaC
  • More to VIM than Meets the Eye
  • Poly-Glutten
  • Creating a Custom Mobi Dictionary

Categories

  • tech learning (3)
  • Uncategorized (1)
“Writing isn't about making money, getting famous, getting dates, getting laid, or making friends. In the end, it's about enriching the lives of those who will read your work, and enriching your own life, as well."
- Stephen King

"Science fiction is arguably the most important genre of all, for it shapes how people understand things."
-Yuval Noah Harari

Bluffdale

By Michael Angel

Property Of Nature

By Michael Angel

Copyright © 2025 The Tembo Team Site.

Omega WordPress Theme by ThemeHall