Skip to content
Remake of tab2opf dictionary builder for kindle
Branch: master
Clone or download
Latest commit 86eb528 Feb 3, 2015
Type Name Latest commit message Commit time
Failed to load latest commit information.
LICENSE Initial commit Feb 3, 2015 Fill in readme Feb 3, 2015 avoid double space erase Feb 3, 2015


Remake of tab2opf dictionary builder for kindle

Script to convert tab delimited dictionary files into opf file to run with kindlegen into a translation lookup dictionary for kindle.

Based on the generally available by Klokan Petr Přidal ( from 2007

The script has been mostly rewritten and extended. The encoding convolutions have been removed, and the code migrated to python3

The input form is: Word(s) \t Definition

By running path/file.txt in the current directory file.opf and file*.html are created which can then be converted with kindlegen file.opf into

--source and --target options define which language to which we are translating.

tab2opf has a -m option to load a module to load getkey and getdef functions and mapping dictionary from that namespace into the current one; if it doesn't find such defined member(s), no error is produced.

getkey converts the term (the Word(s)) into a search key. getdef converts Definition in some arbitrary way. mapping is a dictionary mapping from char -> char to replace some set of characters in the input with characters in the output.

Used and tested is the, which converts a german -> english dictionary ( The keys are the longest word in the Word(s) after removal of prepositional phrases and some pronouns (in getkey). The definitions remap the pattern of "definition \t part-of-speech" into (part-of-speech) definiton.

You can’t perform that action at this time.