06-30-2011, 04:56 AM | #1 |
Junior Member
Posts: 1
Karma: 15548
Join Date: Jun 2011
Device: Kindle
|
How I converted an epub dictionary to mobi format
I recently received a series of great translating dictionaries in epub format. Here is how I converted them to a working mobi dictionary for use on the kindle:
- unzip epub file - convert html files to tab delimited files - concatenate and sort tab delimited files - convert tab delimited file to opf format using tab2opf.py - edit metadata - convert opf file to mobi file using kindlegen This resulted in a mobi file that was recognised as a dictionary by the kindle. The non-obvious steps are detailed below. Convert HTML to tab delimited files The HTML files in the epub container consist of 2 lines per word: one line like this: Code:
<p class="ww"><sub>qword</sub></p> Code:
<p><span class="gag">word</span> ... Convert tab delimited file to opf format using tab2opf.py I found this python script at http://www.klokan.cz/projects/stardict-lingea/ Edit metadata Edit the .opf file generated by tab2opf.py and set the title etc. to the desired values. The following tags might be important to get it working: Code:
<DictionaryInLanguage>en-us</DictionaryInLanguage> <DictionaryOutLanguage>en-us</DictionaryOutLanguage> Kindlegen is provided for free by amazon: http://www.amazon.com/gp/feature.htm...cId=1000234621 Everything together You can use the following (clumsy) script to automate all this a bit more: Code:
#!/bin/sh # Argument 1: epub file to convert TMPDIR=/tmp/convertvandale MYDIR=`dirname "$0"`; mkdir $TMPDIR unzip -d $TMPDIR "$1" for i in $TMPDIR/content/*.html; do "$MYDIR/dicthtml2tab.pl" $i > $i.tab; done cat $TMPDIR/content/*.tab |sort > $TMPDIR/dictionary.tab python "$MYDIR/tab2opf.py" Last edited by Mindtrap; 06-30-2011 at 07:19 PM. |
06-30-2011, 10:09 PM | #2 |
Media Bloke
Posts: 2,381
Karma: 113956855
Join Date: Sep 2010
Location: NSW - Australia
Device: iOS
|
Thanks very much for that post Mindtrap and welcome to Mobile Read.
|
Advert | |
|
07-06-2013, 03:33 PM | #3 |
Member
Posts: 10
Karma: 10
Join Date: Jul 2013
Device: Kindle Paperwhite
|
Hi All,
Did anybody try the instruction above? I have no experience whatsoever with Pearl or Python so i'm really struggling to get this working. Could anyone help with this? When I run the script I get "Can't exec /bin/sh at test.pl line 1." Thanks a lot in advance! |
Tags |
dictionary, epub, kindle, mobi |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Kindle dictionary .mobi format conversion to ePub or other formats | cathene | Kindle Formats | 1 | 08-11-2013 08:00 PM |
ePub to Mobi, table is converted properly | ebookuser | Conversion | 1 | 05-10-2011 03:45 AM |
HELP! Lost search functionality once ePub was converted to .mobi | NYCourtney | Conversion | 0 | 04-26-2011 12:47 PM |
mobi from epub or converted epub | 1611mac | Conversion | 2 | 04-18-2011 07:31 PM |
encoding problem with mobi converted to epub | ldolse | Calibre | 5 | 08-14-2009 12:55 PM |