What sentence mining is

Sentence mining is the practice of extracting vocabulary from native content — games, books, anime — and converting it into Anki flashcards. Instead of studying pre-made vocabulary lists, you learn words in the context of sentences you actually encountered while playing a game you chose.

This approach has two advantages: the words you mine are words you'll encounter again (in this game and others), and the example sentences are meaningful because you lived through them.

The full pipeline overview

🎮
Game displays text
YomiNinja OCR
WebSocket broadcast
Texthooker page
Yomitan hover
Anki card

Step 1 — Install AnkiConnect

AnkiConnect is an Anki add-on that exposes a local HTTP API on port 8765. Yomitan calls this API to create cards. Without AnkiConnect, Yomitan's "Add card" button does nothing.

  1. Open Anki and go to Tools → Add-ons → Get Add-ons.
  2. Enter code 2055492159 and click OK.
  3. Restart Anki when prompted.
  4. Verify it's running: open a browser and go to http://127.0.0.1:8765. You should see AnkiConnect v.6 (or similar). If you see a connection error, Anki is not running.
Keep Anki running in the background during play sessions. AnkiConnect only works while Anki is open.

Step 2 — Configure Yomitan's Anki integration

Inside YomiNinja, open Yomitan Settings. Go to the Anki section.

  1. Toggle Enable Anki integration to on.
  2. Set the Server address to http://127.0.0.1:8765.
  3. Click Test. You should see a green checkmark and the Anki version number.
  4. Under Configure Anki Card Format, select which deck to send cards to and which note type to use.

Recommended note type fields

FieldYomitan variableWhat it contains
Word{expression}The word you looked up
Reading{reading}Kana reading (ふりがな)
Meaning{glossary}Dictionary definition(s)
Sentence{sentence}Full sentence from the game
Pitch{pitchAccentGraphs}Visual pitch accent diagram
Frequency{frequencies}Word frequency from imported list

The Sentence field is the most important for game mining — it contains the game sentence in which you found the word, giving you native context for the flashcard.

Step 3 — Set up a texthooker page

YomiNinja's WebSocket output broadcasts OCR results to ws://localhost:7331. A texthooker page is a simple HTML page that connects to this WebSocket, receives sentences, and displays them as hoverable Japanese text — where Yomitan in your browser can trigger on them.

Recommended texthooker pages

Connecting to YomiNinja

  1. Open the texthooker page in your browser (the browser where Yomitan is installed as an extension).
  2. Find the WebSocket URL field in the texthooker settings. Enter ws://localhost:7331.
  3. Click Connect (or it connects automatically).
  4. The connection status should show "Connected".
Note: YomiNinja's Yomitan (built-in) and your browser's Yomitan are separate instances. For Anki export, use your browser's Yomitan on the texthooker page — its Anki integration connects to your main Anki installation. YomiNinja's built-in Yomitan is used for in-game overlay lookups only.

Step 4 — Mine while playing

With everything connected, your mining session looks like this:

  1. Launch the game in Borderless Windowed mode.
  2. Start YomiNinja with Auto OCR enabled, targeting the game window.
  3. Have your texthooker page open in a browser, visible on a second monitor or in a window you can quickly alt-tab to.
  4. Play normally. Each new game dialogue line appears on the texthooker page within half a second of rendering in-game.
  5. When you encounter a word you want to learn, switch to the texthooker page and hover it with Yomitan in your browser.
  6. Click the green + button in the Yomitan popup to export the word (with its full sentence context) to Anki.
  7. Continue playing.

Card format recommendations for game mining

Sentence cards give the most context

The most effective card format for game mining is a sentence card: the full game sentence on the front (with the target word highlighted), and the reading + definition on the back. This format leverages the complete context the game provided — you remember the scene, the character, the emotion.

Yomitan's {sentence} variable automatically inserts the sentence that contained the word when you made the card.

Verify the sentence before exporting

OCR occasionally misrecognizes characters. Before exporting a card to Anki, quickly glance at the sentence on the texthooker page to confirm it's correct. Cards with OCR errors in the sentence field are worse than no card at all — they plant incorrect Japanese in your memory.

One new word per card, not one new sentence

Target only one unknown word per card. If a sentence has three unknown words, wait until you've learned two of them before mining the third. Cards with multiple unknowns are much harder to review reliably.

What to mine — strategic principles

Mine words in the i+1 zone

The most effective words to mine are ones where the sentence is almost completely understandable — you know everything except the one target word. This is called the i+1 principle. Context makes the new word memorable; a sentence you can't parse makes the card useless.

Prioritize high-frequency vocabulary

Words that appear frequently in games and native content give higher ROI for study time. Frequency lists imported into Yomitan (JPDB, iKnow) show you a star rating or numeric rank in the popup — prioritize words with high frequency over obscure proper nouns.

Mine in sessions, review daily

The most common mistake in sentence mining is creating hundreds of cards in a session and then facing a review mountain the next day. Mine conservatively — 10–20 cards per play session — and keep your daily review load sustainable. Anki's value is in consistent daily review, not in the size of your deck.

Download YomiNinja and set up the pipeline

The WebSocket is always running when YomiNinja is active — connect the texthooker page and you're ready.

v0.9.3 · GPL-3.0