Back

Instructions to Convert Full Book to Anki Deck

#1
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.
Reply

Messages In This Thread
Instructions to Convert Full Book to Anki Deck - by blackstockc - 2015-12-11, 3:01 pm