Fast offline dictionary app to create Anki cards
I use Anki to learn new words in French. It's been a challenge to find a workflow for creating new cards, though. This article is about how my current system works.
Initially, I created cards manually. I'd open up various dictionaries (WordReference, Wiktionary, Termium Plus, Linguee, etc), find a definition that I liked, and copy it into a new Anki card.
There were a few things I didn't like about this approach:
- Requires internet access to load definitions (slow, wasteful, ads)
- Difficult to get standard formatting for new cards (every site is different, can't just copy-paste)
- Too slow! Breaks the flow when I'm trying to read something
To address all these issues, I created french-wiktionary-flashcards, which:
- Uses a local copy of Wiktionary, so no internet access is required
- Automatically creates Anki cards with standardized formatting
- Is super fast!
I can run the app locally on my laptop (completely offline), but I mostly run it on my server and connect over SSH (or Mosh) with my phone.
Here's what it looks like to look up a word and create a new card on my phone. As I type, matching definitions appear. If I'm happy with the definition, I hit Enter to create the card (or Escape to clear the input field):
The Anki deck is synced automatically because I'm running Anki headlessly in the same FreeBSD Jail where I'm running the app. This is accomplished by installing xorg-vfbserver inside the jail, and starting Anki when the jail boots with
Xvfb :0 & export DISPLAY=:0 && sleep 5 && anki
(I initially needed to configure the sync preferences in Anki using VNC inside the jail, and will probably have to do this whenever the session expires — I think that's annually?)
For more details about how the app works, and how to set it up, check out its README. You can browse the source code here, or download it here.