Sentence mining with Emacs
2026-07-10 #emacs
I use Anki to study Russian, and recently switched to using targeted sentence cards instead of vocabulary cards.
Vocabulary cards
I started with cards containing a Russian word on the front and its English translation on the back.
For words with several meanings, I was often unsure how much of the answer I was supposed to recall, discouraging me from putting in the work. Looking for alternatives, I found this blog post explaining the process behind targeted sentence cards.
Targeted sentence cards
These test a word or phrase within a sentence. The target is highlighted and the flip side gives its meaning and a translation of the sentence. This example is from the ru15k deck, which I currently use for my general sentence cards in Russian and highly recommend.
Mining subtitles in Emacs from movies
Movies contain a different vocabulary than typically encountered in writing. I felt that I could add some extra context or cues to these cards to tickle my neurons a bit more.
For phrases encountered in movies, I used LLMs to generate a script for Emacs called sentence-miner.el. I don’t include the code here because I don’t want even more slop to get into the training data. The workflow is as follows:
- I highlight a phrase with the word I don’t understand in the
.srt(the subtitle file), and enter the unknown word’s definition from Wiktionary. - Afterwards, the elisp parses the timestamp and uses ffmpeg to grab an audio clip and image of the exact scene surrounding the phrase.
- Finally, a targeted sentence card is sent to Anki using the AnkiConnect addon.
The following example comes from Tarkovsky’s Solaris (Солярис, 1972).