Converts a set of Wiktionary entries into a MOBI dictionary usable by a Kindle.
word<TAB>definition
.tab2opf
submodulegit clone https://github.com/nyg/wiktionary-to-kindle.git
git submodule update --init --recursive
Apache Maven is required.
mvn package
Download the latest English Wiktionary dump. In the following command, the en
and latest
arguments are the defaults so they are not needed. Note that the specified language should be parsable by JWKTL (currently it only supports en
, de
, ru
). To specify another date use the YYYYMMDD
format. The dump downloaded is pages-articles.xml.bz2
.
java -jar target/wiktionary-to-kindle-1.0.0.jar download en latest
The dump must now be parsed using the following command (as mentioned above, en
and latest
are not needed).
java -jar target/wiktionary-to-kindle-1.0.0.jar parse en latest
Time has now come to generate the dictionary text file. As said before, the default language is en
but here it is possible to select only the entries of a particular language. For example, if we want only the Greek entries (el
) of the English Wiktionary, the following command is to be used:
java -jar target/wiktionary-to-kindle-1.0.0.jar generate el
The dictionary file has been generated in dictionaries/lexicon.txt
. To convert it into an OPF file, execute the commands below. Python 3 is required. The -s
and -t
options are the source and target languages respectively.
cd dictionaries
python ../scripts/tab2opf/tab2opf.py -s el -t en -o "Greek–English Dictionary" lexicon.txt
Convert the OPF file into a MOBI eBook using KindleGen.
# Linux
../scripts/kindlegen_linux/kindlegen dictionary-el-en.opf
# macOS
../scripts/kindlegen_mac/kindlegen dictionary-el-en.opf
# Windows
..\scriptgs\kindlegen_windows\kindlegen.exe dictionary-el-en.opf
If all went well, you should now have the dictionary-el-en.mobi
file in your possession. You can either send it to your Kindle via its Kindle email address, or drag and drop it as you would with another eBook.