Month: November 2017

Kindle Vocabulary Builder into Memrise

Introduction

A script to pull Kindle Vocabulary Builder DB and convert into Memrise course.

The latest Kindle Paperwhite (second generation) offers the Vocabulary Builder feature. With Vocabulary Builder, you can look up words with the dictionary and memorize their definitions.

For my self-education I use http://memrise.com/ (both on my phone and desktop PC). I thought it would be great to pull words which I’ve checkded when reading English books on my Kindle and push them into my Memrise course.

How does it work?

  1. The script reads through the vocab.db to look for all Engligh words (in table WORDS).
  2. Each of the words (aka stems) is used for a definition lookup in the Cambridge Dictionary
  3. Retreve word definitions, usage example, pronounciation, audio mp3 and insert into a new SQLite database memrise.db (the mp3 is written to the disk only, folder audio)
  4. Each new word is written to a text file, in a format suitable for bulk words import into Memrise.

Pre-requisties

  • Kindle Paperwhite (or newer)
  • vocab.db file (retrieved from your Kindle, from /Volumes/Kindle/system/vocabulary/)
  • python 3
  • BeautifulSoup

References

I heavily sourced from two GitHub projects:

ToDOs

  • Parametrize hardcoded things – especially language pair English-Polish
  • Upload Audio files with prononciation

Usage

DB conversion using the script

MBP:kindle-to-memrise jhartman$ ./kindle2memrise.py -h
usage: kindle2memrise.py [-h] [-kindleDB KINDLEDB]
                         [-dictionaryDB DICTIONARYDB] [-output OUTPUT]
                         [-revision REVISION] [-debug]

optional arguments:
  -h, --help            show this help message and exit
  -kindleDB KINDLEDB    Kindle vocabulary db filename (default: vocab.db)
  -dictionaryDB DICTIONARYDB
                        Memrise dictionary db filename (default: memrise.db)
  -output OUTPUT        Output file to import to memrise.com (default:
                        memrise.txt)
  -revision REVISION    Revision to output. Not specfied (default): last, 0 -
                        all
  -debug                Enable debug

At minimum, the tool does not require any parameters, it will search for vocab.db in the current folder and will write output files into the same, current folder.

Pay your special attention to memrise.txt which has been generated:

MBP:kindle-to-memrise jhartman$ tail memrise.txt
mere    Sam. Used to emphasize that something is not large or important. Example: It costs a mere twenty dollars.   mɪər
thinning    Rozcieńczać, rozrzedzać. To make a substance less thick, often by adding a liquid to it. Example: N/A   θɪn
carnivore   Zwierzę mięsożerne. An animal that eats meat. Example: N/A  ˈkɑːnɪvɔːr
embrace Obejmować (się). If you embrace someone, you put your arms around them, and if two people embrace, they put their arms around each other.. Example: We are always eager to embrace the latest technology.   ɪmˈbreɪs

This is the file, which will be used for bulk word add into your Course.

Bulk word add

Go to your Course, press Edit and in the Advanced options, look for Bulk add words:

Bulk Add words

Open memrise.txt in an editor (e.g. Notepad), select all, copy it and paste into Memrise Bulk Add form then press Add:

Bulk Add words

That’s it!

Download

Download the script from GitHub: https://github.com/jaroslawhartman/kindle-to-memrise