Mobileread
How to convert mobi dictionary to StarDict?
#1  playful 06-23-2019, 10:55 AM
Howdy conversion experts,

After ten years on Kindle I'm about to move to Onyx, which uses dictionaries in the StarDict format.

I'm particularly attached to the Spanish-English dictionary I'm using and haven't found any large SP-SP or SP-EN dictionaries in StarDict format (I looked on the huzheng site, maybe not deep enough).

The Penelope tool converts to StarDict, but not from mobi or epub.

Would some of you please provide some pointers to known tools or procedures to take a mobi (or even better, azw) dictionary and port it to StarDict?

Big thanks.
Reply 

#2  Doitsu 06-23-2019, 06:34 PM
Quote playful
Would some of you please provide some pointers to known tools or procedures to take a mobi (or even better, azw) dictionary and port it to StarDict?
AFAIK, there's no Kindle to StarDict converter.

You'd have to do the following:
  1. De-DRM the dictionary.
  2. Unpack it with KindleUnpack.
  3. Reformat the source .html file to a Babylon GLS file.
  4. Convert the Babylon GLS file to a StarDict dictionary with StarDict Editor.
Especially the third step is rather time-consuming, unless you're a regex expert.

BTW, the Babylon GLS file should look like this:

Code
#stripmethod=keep
#sametypesequence=h
#bookname=Spanish-English Dictionary
libro|libros
<p>single line definition of 'libro' (may contain html 3.2 tags, e.g <br>)</p>
rana|ranas
<p>single line definition of 'rana' (may contain html 3.2 tags, e.g <br>)</p>
Reply 

#3  playful 06-23-2019, 06:57 PM
Quote Doitsu
AFAIK, there's no Kindle to StarDict converter.
You'd have to do the following:
Fantastic, thank you so much.

As luck would have it, not wanting to boast but it's probably fair to say I'm a regex expert and have the tools ready for a conversion pipeline. That being said, expert or not it's very easy to get things wrong, so we'll see…
Huge thanks.
Reply 

#4  Doitsu 06-24-2019, 03:14 AM
Quote playful
That being said, expert or not it's very easy to get things wrong, so we'll see…
I forgot to mention that you'll need to use the following non-standard link syntax to link to another headword:

Code
see also: <a href="bword://libro">libro</a>
and headwords need to be followed by all inflected word forms/spelling variants (defined as <idx:iform value="xxx"/> in the .html file):

Code
go|goes|went|gone|going
<div><b>1. </b>first definition of 'go'<br><b>2. </b>second definition of 'go'</div>
Reply 

Today's Posts | Search this Thread | Login | Register