Skip to content

An Anki add-on to convert user highlighted words to Anki decks containing cards of sentences and their associated highlighted words

Notifications You must be signed in to change notification settings

kanjieater/Smart-Japanese-Kindle-Highlights

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This add-on makes Anki cards from words you've highlighted. By highlighting only the word you read on your kindle, this add-on can generate a card containing:

  1. The deconjugated word you read
  2. The sentence the highlighted word was used in
  3. The meta data of when and where this word was read

Here's a video covering the features & setup:

How does it work?

It works by looking up the highlighted text in the Kindle's built in Vocab Builder feature which automatically records sentences of words you looked up.

It then matches the words to sentence usages, and pulls the deconjugated word, sentence, and meta data, and creates a card in a deck named after the book.

Every time you run it, it records when you last generated cards, and continues from where it left off - making adding new cards from you Kindle practically effortless.

Current Limitations

  • This only supports kindles in the Japanese language and Japanese books; Each kindle's highlight format is different depending on the language
  • Windows is the only officially supported platform, though Mac & Linux should work; PR's welcome
  • Only supports Kindle's with My Clippings.txt (no html/Android based clippings)

Kindle Limitations

  • Books must use a Kindle vocab compatible format: .azw3 is compatible; .mobi is not (though some have gotten it to work); I used Calibre to easily convert my books that were mobi to azw3 without any issues (covers still work if you delete any Amazon ids)
  • Only matches what your Kindle dictionary finds. The Kindle automatically makes /system/vocabulary/vocab.db and updates it with words that were found in the dictionary. The entries in this are automatically created by the Kindle itself. If your dictionary couldn't find it, you'll have to make a card manually for the word (the add-on will prompt you in this case).

Instructions

  1. Make sure Vocab Builder is on, on your Kindle device (inside Settings -> Reading Options)
  2. Make sure you Kindle is in Japanese
  3. Make sure your Kindle highlights are in KindlePath/documents/My Clippings.txt, where KindlePath is something like F: or whatever your Kindle's drive is: F:/documents/My Clippings.txt
  4. I recommend erasing the contents of My Clippings.txt for the first time you use this, just to make sure you don't have any words or sentences that could mess up the matching.
  5. Set up the add-on config variables:
{
    "model_name": "Japanese", 
    "word_field": "Vocab",
    "sentence_field": "Expression",
    "source_field": "Meta",
    "deck_name": "!優先::1 自分::kindle",
    "last_added": null,
    "path": "F:/"
}
  1. model_name is the model to use for the cards. This model must have fields in it named whatever the word_field, sentence_field, and source_field are.

  2. word_field is where the deconjugated word will be put in the card

  3. sentence_field is where the sentence where the word was used will be put in the card

  4. source_field is where the meta data of what page and what time you highlighted the word. It looks something like this: ページ78 2021年2月3日水曜日 8:50:57 食べて

  5. deck_name is the "root" deck where sub decks will be created. Every highlight imported will be placed in a subdeck named after the book it was read from. So in my case, I have a deck named !優先, which is where my Japanese cards are, with a subdeck of 1 自分 where I put cards I make myself, with a sub-deck of kindle where are the kindle cards are generated to. Inside kindle I have decks like 狼は眠らない, which is the name of a book I read, and generated cards to automatically.

  6. last_added is when the last Kindle Highlight was added. Don't change this unless you want it to rescan & readd cards from that time. If you set it to null it will start at the beginning of all of your highlights.

  7. path the root path of your Kindle device. It expects F:/documents/clippings and a hidden folder & file F:/system/vocabulary/vocab.db to exist.

Tips on Usage

  • After hitting 10k sentence cards, I switched all of my cards to Vocab cards. As generated vocab cards, these autogenerated cards work great. As sentence cards, you would want to manually make the sentences as short as possible to provide context. Shorter sentence cards are better. Hot Take: Vocab cards are even better if you're actually spending time reading daily. Use Anki for vocab entries, use immersion to get things to actually sink in. Sentence cards take 30% longer to review I've found.

Thank You

  • HelenFoster: Your add-ons are some of the best written code, and I frequently use snippets in my own code
  • gmcmanus: Your English kindle highlighting add-on helped inspire this add-on & I was able to re-use a portion of that code

Update History 2/13/2021 - Initial Release! 2/14/2021 - Bug fix on importing the add-on. Added a dialog so feedback of the highlight scanning starting is immediate (otherwise if you have hundreds of highlights it might look like it's not working). 2/20/2021 - Better error handling for bad configuration. The add-on will now tell you (instead of throwing an error) when something goes wrong with file paths, Note Types, and missing fields 2/20/2021 - Updated again to fix issues with parsing for some users 3/11/2021 - Add-on now ignores buggy highlights that are duplicates (same source and vocab) or if the highlight is blank. The add-on now creates cards in chronological order. Support

If you have an issue, join the discord & post in #tech-support: https://discord.com/invite/agbwB4p

If you find my tools useful please consider supporting via Patreon. I have spent countless hours to make these useful for not only myself but other's as well and am now offering them completely 100% free.

Motivate me through PayPal: Please follow the a link below to buy me a coffee, sandwich, meal, or anything else you'd like if you find my work interesting.

If you can't contribute monetarily please consider following on:

About

An Anki add-on to convert user highlighted words to Anki decks containing cards of sentences and their associated highlighted words

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages