kanji koohii FORUM
Instructions to Convert Full Book to Anki Deck - Printable Version

+- kanji koohii FORUM (http://forum.koohii.com)
+-- Forum: Learning Japanese (http://forum.koohii.com/forum-4.html)
+--- Forum: Learning resources (http://forum.koohii.com/forum-9.html)
+--- Thread: Instructions to Convert Full Book to Anki Deck (/thread-13437.html)



Instructions to Convert Full Book to Anki Deck - blackstockc - 2015-12-11

Hello all,

It's been years since I posted anything here, but I've recently hacked together what I think is a pretty effective way of reading/studying books in a foreign language.  I thought this would be a good place to share it.  If there is already a similar process being used by this group, it's probably better than mine, so let me know Smile


This is a 15 minute process that will turn an entire ebook into an anki deck with clauses in your target language on one side , and an auto-generated translation on the back.  I've used anki to read several full novels this way, simply deleting any sentences that I already understand or don't care to remember. 

To do this you will need:

-an ebook in your target language.  I've done this with epub and mobi files.  Any thing with parsable text should work.  You could also just copy and paste text from Aozora bunko or any website.  
-microsoft word and excel
-a google drive account so that you can use google spreadsheets

1) acquire an ebook in your target language
2) feed it to zamzar.com to convert it to txt
3) copy and paste the text into microsoft word
4) run a search/replace for all clause-defining punctuation.  The goal is to break long sentences down into more manageable, flash-card size chunks by replacing punctuation with carriage returns.  The symbol for carriage return is "^p."  The punctuation will change depending on your language, but for a french book I use:
    ,  with ,^p
    ;  with ,^p
    .  with .^p
    ! with !^p
5)Now paste the entire contents of your word document into excel and remove blank rows.  To do this, select the row with all the text, select "find and select -> goto special" select "blanks," and then hit the delete icon in the home menu.
6)Paste the entire contents of the excel document into google sheets.   You should have several thousand rows of text with no blanks.
7)Click on the top cell to the right of the text and enter the formula: =GoogleTranslate(A1,"jp","en")  This should auto translate the text for one cell.
8)Copy the formula, and paste it to the entire second column.  You should be able to do this with one copy/paste combo.  It can take more than half and hour for google translate to process the entire book.
9) save to your computer as CSV
10) Import to anki

I'm sure that this process can be streamlined, but it's easy enough and has worked well for me so I thought I would share.  Let me know if you have any questions. If anything is unclear I can update with more details/screenshots.


RE: Instructions to Convert Full Book to Anki Deck - yogert909 - 2015-12-11

(2015-12-11, 3:01 pm)blackstockc Wrote: the formula: =GoogleTranslate(A1,"jp","en")  This should auto translate the text for one cell.

This is pretty cool.  I didn't know google sheets could do this.  

Your idea is pretty cool though.  I might give it a try when I start reading in earnest in about a month. You could probably streamline one step by skipping excel doing all the spreadsheet stuff in google sheets and skipping excel all together.  I'm not sure if google sheets lets you delete the blank rows, but you could easily delete them in word by searching multiple carriage returns.


RE: Instructions to Convert Full Book to Anki Deck - Splatted - 2015-12-11

Thanks I can definitely see myself using this if I ever manage to get my l3 to a native material ready level.


RE: Instructions to Convert Full Book to Anki Deck - RandomQuotes - 2015-12-11

I've done a similar thing with LibreOffice minus the auto generated translations. Even without them, the bite-sized reading chunks can be very useful. I think while one should be wary of machine-generated translations this trick could be pretty useful.


RE: Instructions to Convert Full Book to Anki Deck - blackstockc - 2015-12-12

Yep, there are ways to do this with google spreadsheets but it is a lot more complicated.  One of the useful things about excel is that it offers and easy way to delete blanks without resorting the data, which is important for keeping the text in order.


RE: Instructions to Convert Full Book to Anki Deck - dudeshane01 - 2015-12-12

A neat idea will be to start a new free blog somewhere, make it hidden from public and copy paste all that text into blogpost. Divide into multiple blogposts if text is too long to make chapters.
Then you can use rikaichan to read that on firefox. Much better than reading auto tranations.
A step further will be to save all new words you encounter to anki importable text file. this will give you your personal vocabulary deck.


RE: Instructions to Convert Full Book to Anki Deck - SomeCallMeChris - 2015-12-13

Personally I think that google translate is terrible enough that I wouldn't go through all these steps.

Going through most of the steps, but instead of translating just take the Word (or OpenOffice in my case) document and save it as HTML. Open the file in Firefox, and then Rikai(chan/sama) can be used for quick lookups. Still might need to look some stuff up in the dictionary.

If your grammar isn't good enough to read a sentence even with dictionary lookups, then it also isn't good enough to tell when google translate is giving you misleading nonsense instead of a correct translation. (Although of course not all google translate sentence are misleading... some of them are -obviously- wrong. Oh, and sometimes it's even close to correct.)