This program generates .apkg
deck directly from vocab.db
located in your Kindle device. English support only.
-
Definitions are automatically filled in with (maybe) correct sense
The word sense disambiguation (WSD) is powered by pywsd and WordNet. Though WSD is not perfect, it is good enough in my opinion and you can just edit the file when reviewing if you see an incorrect definition.
-
Manual mode
You can use manual mode and select the correct word sense one by one if you want absolute accuracy.
-
IPA (en-us) are automatically added
This is powered mostly by English-to-IPA, and Merriam-Webster Dictionary's free API as well. Providing your own API key is optional.
-
Source book of the word is added to the card
So you can recall where did you see the word. It is currently not used in the card template, edit it as you like.
-
Clone this project
git clone https://github.com/johan456789/yaktoa.git
-
Install dependencies
pip install -r requirements.txt
-
(Optional) Get a Merriam-Webster Dictionary's free API, use your credentials and edit
cred.py
accordingly.This step is optional. If the word's IPA is not found, the field will be left blank.
The Merriam-Webster Dictionary API is free as long as it is for non-commercial use, usage does not exceed 1000 queries per day per API key, and use is limited to two reference APIs.
Before running the script:
- Copy
/Volumes/Kindle/system/vocabulary/vocab.db
toyaktoa
.
usage: python main.py [-h] [-i INPUT] [-o OUTPUT] [--no_ipa] [-p] [-m]
optional arguments:
-h, --help show this help message and exit
-i INPUT, --input INPUT
Input filename
-o OUTPUT, --output OUTPUT
Output filename
--no_ipa Leave IPA field empty
-p, --print Print first 5 vocabularies
-m, --manual Manually select definition
-a, --all Process all books
-
Run script and type the index of the book interested.
python main.py -i vocab.db -o output.apkg
-
Wait and voilà! The deck is saved as
output.apkg
.The free API plan has some limitations and I have to sleep for 2 seconds for another request, so it takes some time.
Run script with -m
or --manual
tag.
python main.py -i vocab.db -o output.apkg -m
-
Type the number of the book you want:
-
Select correct word senses (the green one is what
pywsd
predicts):- Type the number with correct word sense and press enter:
- Simply press enter if the predicted sense is correct:
Lower left numbers (2/14) tell you the current progress. There are a total of 14 vocabularies and it's the 2nd one.
-
Wait for IPA queries and it's done!
Without them this project would have been much harder.
genanki, pywsd, English-to-IPA WordNet, Merriam-Webster Dictionary