Hi folks,
I recently purchased a Kindle Paperwhite and needed a way to easily import unknown words I find in the books I read without having to interrupt my reading and write the word down on paper or on my computer.
The Kindle has a feature that lets you highlight sections of the text (or in this case, words) you're reading and adds the highlight to a text file located on the Kindle in the documents folder (documents\My Clippings.txt). This text file keeps track of which book the highlights were made in, at what approximate location in the text, and what was highlighted.
I created a tool that is meant to work alongside Rikaisama to allow you to easily import into Anki words that you highlighted, along with the sentences you read them in. The only requirement is having a text or HTML copy of the book (i.e the tool cannot read .MOBI files directly). If you do not have a text/HTML copy, you can probably manage to extract an HTML copy of the book using tools such as KindleUnpack.
The tool generates a temporary HTML file containing the words + sentences and opens them up in your default browser (which is probably Firefox if you are using Rikaisama often). The produced HTML file looks like this:
![[Image: 4v2wzr.png]](http://i48.tinypic.com/4v2wzr.png)
The round icon on the left side is a link to Google.co.jp with results filtered on Japanese language pages - I use this to check if a word is popular or not before adding it (i.e if a word only comes up with 100k results, I rarely add it to anki, but tend to add anything that returns 500k and above). At this point, all you have to do is mouse-over the red words (which correspond to the text you highlighted) with Rikaisama turned on, press S, and you're done. Note that the sentence-finding is approximate - the program might end up finding the word in another sentence than the one you highlighted it in, but most of the time, it should be alright (especially with uncommon words).
The program itself looks like this:
![[Image: 2zs410k.png]](http://i45.tinypic.com/2zs410k.png)
When you open it up, it tries to detect your Kindle if it is plugged in. If it can't, you will have to manually select a "My Clippings.txt"-format file in the first field.
-The "Book Name" field is a list of different books for which you've added highlights on your Kindle - you need to select the book you are interested in importing into Anki.
-The "Book File" field is the text/HTML version of the book you were reading on your Kindle.
-The "Book File Encoding" field defines whether the text/HTML file is written in Shift-JIS encoding or UTF-8. Autodetect should work for most cases, so there is no need to worry about this particular field.
Once you've selected everything, you can simply hit the "Generate" button and the generated HTML file will pop up in your browser, and you can easily import with Rikaisama from there.
If anybody is worried/interested, the code (C#) is here: http://pastebin.com/1fgQwJ3L
It's a something I put together last evening in a couple of hours, so don't expect the code to be all that clean.
And lastly, the program itself is here (it requires .NET 4.0 to be installed on the computer): http://dl.dropbox.com/u/44590151/ClippingsToAnki.zip
Hopefully someone finds this useful!
I recently purchased a Kindle Paperwhite and needed a way to easily import unknown words I find in the books I read without having to interrupt my reading and write the word down on paper or on my computer.
The Kindle has a feature that lets you highlight sections of the text (or in this case, words) you're reading and adds the highlight to a text file located on the Kindle in the documents folder (documents\My Clippings.txt). This text file keeps track of which book the highlights were made in, at what approximate location in the text, and what was highlighted.
I created a tool that is meant to work alongside Rikaisama to allow you to easily import into Anki words that you highlighted, along with the sentences you read them in. The only requirement is having a text or HTML copy of the book (i.e the tool cannot read .MOBI files directly). If you do not have a text/HTML copy, you can probably manage to extract an HTML copy of the book using tools such as KindleUnpack.
The tool generates a temporary HTML file containing the words + sentences and opens them up in your default browser (which is probably Firefox if you are using Rikaisama often). The produced HTML file looks like this:
![[Image: 4v2wzr.png]](http://i48.tinypic.com/4v2wzr.png)
The round icon on the left side is a link to Google.co.jp with results filtered on Japanese language pages - I use this to check if a word is popular or not before adding it (i.e if a word only comes up with 100k results, I rarely add it to anki, but tend to add anything that returns 500k and above). At this point, all you have to do is mouse-over the red words (which correspond to the text you highlighted) with Rikaisama turned on, press S, and you're done. Note that the sentence-finding is approximate - the program might end up finding the word in another sentence than the one you highlighted it in, but most of the time, it should be alright (especially with uncommon words).
The program itself looks like this:
![[Image: 2zs410k.png]](http://i45.tinypic.com/2zs410k.png)
When you open it up, it tries to detect your Kindle if it is plugged in. If it can't, you will have to manually select a "My Clippings.txt"-format file in the first field.
-The "Book Name" field is a list of different books for which you've added highlights on your Kindle - you need to select the book you are interested in importing into Anki.
-The "Book File" field is the text/HTML version of the book you were reading on your Kindle.
-The "Book File Encoding" field defines whether the text/HTML file is written in Shift-JIS encoding or UTF-8. Autodetect should work for most cases, so there is no need to worry about this particular field.
Once you've selected everything, you can simply hit the "Generate" button and the generated HTML file will pop up in your browser, and you can easily import with Rikaisama from there.
If anybody is worried/interested, the code (C#) is here: http://pastebin.com/1fgQwJ3L
It's a something I put together last evening in a couple of hours, so don't expect the code to be all that clean.
And lastly, the program itself is here (it requires .NET 4.0 to be installed on the computer): http://dl.dropbox.com/u/44590151/ClippingsToAnki.zip
Hopefully someone finds this useful!

