MobileRead Forums

MobileRead Forums (https://www.mobileread.com/forums/index.php)
-   Workshop (https://www.mobileread.com/forums/forumdisplay.php?f=178)
-   -   How to create your own mobipocket dictionary for any language: (https://www.mobileread.com/forums/showthread.php?t=20480)

drago 02-12-2008 06:17 AM

How to create your own mobipocket dictionary for any language:
 
I was very gratefull to Adam B for porting the Stardict dictonary tool for the Iliad, but I allways longed for the kind of instant lookup, which is possible from mobipocket. Unfortunately mobipocket dictionaries are not available for more exotic languages, so I allways wanted to create my own mobipocket dictionaries. It seems I have now found a solution:

First you need to get hold of a tab delimited dictionary file. (example. dictionary.txt)

(Stardict dictionary files are available from: http://stardict.sourceforge.net/Dictionaries.php
These can be converted into a tab delimited file by the stardict editor programe, which you can find here: http://stardict.sourceforge.net/other.php )

Once you have such a file, use tab2opf.py from http://www.klokan.cz/projects/stardict-lingea/
This is a free python script by Petr Klokan, so you’ll need python isntalled.

Type tab2opf.py dictionary.txt into the command line to run the script.

This will give you a dictionary.opf file, and a number of dictionary0.html files

Edit the dictionary.opf file, to specify the name of the dictionary, and the impot output languages.

Get mobigen.exe form - http://www.mobipocket.com/soft/prcgen/mobigen.zip

Extract mobigen exe

Run mobigen.exe dictionary.opf

If you did everything right, you’ll get dictionary.mobi which’ll be the desired mobipocket dictionary.

Cheers!

D.

templario 02-12-2008 06:33 AM

Thatīs very interesting and helpful. Thanks for sharing. Just one question, can this be done in a windows machine?

Thanks

drago 02-12-2008 06:44 AM

Templario,

yes, I have done it on a win machine. Stardict editor has a win version, python can be instaled for windows, and mobigen. exe is windows only.

Btw. it seems mobigen.exe runs under wine as well, so this can also be done on a Linux box.

Cheers!

D.

ericshliao 02-12-2008 06:57 AM

Mobipocket Reader on iLiad still have problem displaying non-western glyphs, such as Chinese glyphs. I think Japanese and Korean glyphs are no exception.


Edited:
With proper modification, CJK glyphs can be displayed on Mobipocket Reader. See this:
http://forum.irexnet.com/viewtopic.php?t=2281

hellosim 02-13-2008 02:48 AM

I followed your step in winXP.

installed stardict3.0, installed GTK2 Runtime, downloaded dictionary files, extracted with 7zip, run stardict editor.

after I select *.dict.dz file, It verifies. BUT If I select decompile, it says

Building...
Error, file version is not 2.4.2
Done!

What does it mean?

drago 02-13-2008 06:02 AM

This happened to me as well. What i did, was I extracted the .dict file from the .dz (i don't know what kind of encryption this is, but ctrl-pgdown in total commander dealt with it.) In stardict editor under decompile you need to select the ifo file. Sometimes it refused to decompile giving me the error message sametypesequence not m, but after changing the sametypesequence=x line in the ifo file to sametypesequence=m it decompilled.

Good luck!

D

ericshliao 02-15-2008 01:03 AM

The .dz file is actually a .gz format archive. You should rename the .dz to .gz, then unpack it. There should be a .dict file in it. The .dict file is the uncompressed dictionary file for decompiling.

drago 02-16-2008 03:07 AM

Update: creating the dictionaries with Mobipocket Creator Publisher Edition gave better and more consistent results than using the command line mobigen.exe.
Get it from:
http://www.mobipocket.com/en/Downloa...tion=Publisher

Create new publication
----create presonal dictionary-glosary
important: specify the language, and select the input-output languages at the book-setting tabs, without this, instant lookup won't work. (Also I got the best results with unicode encoding.)
drop all the numbered .html files created by the tab2opf.py (leave they .opf file alone)
click on build

Enjoy!

D.

wagnerian 02-25-2008 01:34 AM

1 Attachment(s)
I have built a yet another tab2mobi script because the tab2opf.py does not support Asian characters.

Install BeeLiner first:
http://wing4bee.tistory.com

And put this script package and mobigen.exe into the directory where BeeLiner is installed.
Modify the MyDict.opf file and run:
tab2mobi.cmd your_source_file.txt

ericshliao 02-25-2008 08:13 AM

By my experience, with a "-utf" option, the original tab2opf.py can deal with Chinese characters.

wagnerian 02-25-2008 01:02 PM

Quote:

Originally Posted by ericshliao (Post 153159)
By my experience, with a "-utf" option, the original tab2opf.py can deal with Chinese characters.

Oops! It does work! :smack:

PointBoom 04-16-2008 05:15 PM

Thanks for this great post! It allowed me to find and get a dictionary running very quickly.

One query though:
I created a French-English Dictionary. And it works great except when the word is not found and a 'manual search' option is offered. Clicking on that throws an error. For example:

Could not open: c:\path to dictionary\french-english-dict.prc(window.index_search('','','notamment'))

I found that by deleting the idx:key tags and recompiling things that the manual search started working nicely.

My question is: What was hoped to be accomplished with the idx:key tags?

I noticed that (some of/all of?) the accents had been removed in the idx:key tags. If this was meant to allow searching without accents maybe this could be done with the 'inflections' tagging? Any ideas? I'm wondering if the script needs modification (or if I buggered something up making the change).

moontaxi 04-20-2008 11:58 AM

drago, wagnerian, ericshliao, pointboom

can any of you, who succeed this work, convert babylon files using dictconv and make a mobipocket dictionary for me? i'm running windows xp and linux is the only system that i can convert babylon files.

this is the link for dictconv (to convert babylon to stardict format)
http://linux.softpedia.com/get/Educa...nv-23446.shtml

i uploaded 5 babylon dictionaries here: (3,64mb)
http://rapidshare.com/files/108999822/Babylon.rar.html

i'll be glad.

wagnerian 04-25-2008 03:14 AM

moontaxi, it's extremely difficult to me to figure out the match-the-cat-pictures task of the RapidShare.
I've tried and failed three times and finally given up. :(

artbatista 05-12-2008 09:31 PM

It's silly, but it makes me feel better to know I am not the only one that can not decode the damned cats..


Art



Quote:

Originally Posted by wagnerian (Post 174072)
moontaxi, it's extremely difficult to me to figure out the match-the-cat-pictures task of the RapidShare.
I've tried and failed three times and finally given up. :(


ricdiogo 06-18-2008 10:49 PM

Does StarDict Editor generate a txt file?
I'm not sure if StarDict Editor is doing what it's supposed to...
I change the the *dict extension to *txt by hand an then, in my command line I type:

c:\
c:\cd Python25
c:\tab2opf.py dictionary.txt

I get a syntax error message.

No OPF file gets generated.

Boy, oh boy...!

wallcraft 06-19-2008 10:27 PM

Quote:

Originally Posted by ricdiogo (Post 200845)
Does StarDict Editor generate a txt file?

Yes. Decompile the dict.ifo file and you should get a dict.txt file. For me, it ended up in the same directory as stardict-editor.exe. Any plain text editor can be used to confirm that it is a tab delimited file (a <tab> between the word and its definition).

ricdiogo 06-20-2008 05:18 PM

Quote:

Originally Posted by wallcraft (Post 201330)
Yes. Decompile the dict.ifo file and you should get a dict.txt file. For me, it ended up in the same directory as stardict-editor.exe. Any plain text editor can be used to confirm that it is a tab delimited file (a <tab> between the word and its definition).

Thanks. I got the file. It has lots of </k>\ tags in it. Is that normal?

About the py thing... any help?

ericshliao 08-07-2008 06:53 AM

How to merge two dictionarys during conversion? Have anybody tried it?

gravity404 10-26-2008 06:35 PM

Chinese Mobipocket Dictonary for Windows Mobile Based Phones and Pocket PC's (PPC)
 
Thank you for all your posts and help! I did it! I created a Windows Mobile Based Mobipocket English to Chinese Dictionary. Feel free to download it and give feedback:

http://gravity404.googlepages.com/

Thanks again for all the good posts!:)

owl123 11-29-2008 11:36 AM

Quote:

Originally Posted by hellosim (Post 149001)
I followed your step in winXP.

installed stardict3.0, installed GTK2 Runtime, downloaded dictionary files, extracted with 7zip, run stardict editor.

after I select *.dict.dz file, It verifies. BUT If I select decompile, it says

Building...
Error, file version is not 2.4.2
Done!

What does it mean?

I'm having exactly the same issue. "Error, file version is not 2.4.2" is displayed. In my .ifo file it says it's 3.0.0 version. What do I do? .dict is uncompressed.

EDIT: It seems the reason was that my .ifo file had charset which was incompatible with StarDict Editor.

owl123 11-29-2008 06:21 PM

Quote:

Originally Posted by moontaxi (Post 172316)
drago, wagnerian, ericshliao, pointboom

can any of you, who succeed this work, convert babylon files using dictconv and make a mobipocket dictionary for me? i'm running windows xp and linux is the only system that i can convert babylon files.

this is the link for dictconv (to convert babylon to stardict format)
http://linux.softpedia.com/get/Educa...nv-23446.shtml

i uploaded 5 babylon dictionaries here: (3,64mb)
http://rapidshare.com/files/108999822/Babylon.rar.html

i'll be glad.

Here are Babylon dictionaries that are already converted to StarDict: http://reciteword.sourceforge.net/stardict/babylon.php. Decompile them with StarDict Editor (to .txt) and then use tab2opf.py python script. It'll take you a minute.

kaas 02-01-2009 07:47 AM

Ok, I feel quite stupid now :(
I have downloaded the stardict dictionary files (*.dz, *.idx, and *.ifo) and extracted the *.dict from the *.dz file in the same directory. But here I am stuck. Trying to use the stardict-editor, I always get the same error message:
Building...
Error, file version is not 2.4.2
Done!

Could one of you give me a step by step instruction of what to do next? I really would appreciate it!
Thanks,

kaas

ericshliao 02-01-2009 08:41 AM

IIRC, you should have a GTK+ for MS Windows installed to use the editor. I may be wrong, because it's been sometime since I did that conversion.

kaas 02-01-2009 08:59 AM

I have it installed. when I try to convert the file, it now says: no tab in line 1, no tab in line 2, etc...

thanks for your help,

kaas

p.s.: I can start the editor successfully, the next steps aren't clear to me.

arvsinha 02-07-2009 01:20 PM

I cannot make the python script work.

arvsinha 02-07-2009 02:44 PM

Quote:

Originally Posted by kaas (Post 340800)
Ok, I feel quite stupid now :(
I have downloaded the stardict dictionary files (*.dz, *.idx, and *.ifo) and extracted the *.dict from the *.dz file in the same directory. But here I am stuck. Trying to use the stardict-editor, I always get the same error message:
Building...
Error, file version is not 2.4.2
Done!

Could one of you give me a step by step instruction of what to do next? I really would appreciate it!
Thanks,

kaas

First download the stardict file. Extract using winrar.
There is a file by the name of ***.dict.dz
rename this file to ***.dict.gz
Download 7 zip software and extract this file - You shall get ***.dict file.
Now fire up the stardict-editor -
You basically get three tabs when it open viz Compile, Decompile and edit
The Decompile tab is what we are interested in.
Go the decompile tab and click browse - Choose the ***.ifo file - Not the dict file ) and click decompile.
This would lead to creation of text file ***.txt
Use tab2opf.py script to convert this txt file into opf.
This should lead to creation of multiple html files and opf file.
Use mobigen.exe to convert it to a dictionary.
Hope this helps.
I Managed. :)

mlvpf 02-10-2009 12:24 PM

Quote:

Originally Posted by arvsinha (Post 345528)
First download the stardict file. Extract using winrar.
There is a file by the name of ***.dict.dz
rename this file to ***.dict.gz
Download 7 zip software and extract this file - You shall get ***.dict file.
Now fire up the stardict-editor -
You basically get three tabs when it open viz Compile, Decompile and edit
The Decompile tab is what we are interested in.
Go the decompile tab and click browse - Choose the ***.ifo file - Not the dict file ) and click decompile.
This would lead to creation of text file ***.txt
Use tab2opf.py script to convert this txt file into opf.
This should lead to creation of multiple html files and opf file.
Use mobigen.exe to convert it to a dictionary.
Hope this helps.
I Managed. :)

Thanks, arvsinha. I followed ur instructions and produced the txt file but could not proceed using the the tab2opf.py script to convert the txt file. Can you (or anybody) please give step-by-step instruction or assist by ulpoading ready made script with instruction. I'm not knowledgeable in programming.:help:

wallcraft 02-10-2009 06:47 PM

Quote:

Originally Posted by mlvpf (Post 348522)
Thanks, arvsinha. I followed ur instructions and produced the txt file but could not proceed using the the tab2opf.py script to convert the txt file.

See Visual Kindle Guide for instructions on how to install Python (KindlePID) and run a similar python script (KindlePID). I would not bother adding a python directory to your "path", but rather I suggest copying tab2opf.py (and mobigen.exe) to the directory containing the dictionary. Then the command tab2opf from a command window that has been "cd"-ed to this directory should give you a usage message (to tell you what arguments to use). Or perhaps arvsinha can post the actual command lines for tab2opf and mobigen.

arvsinha 02-15-2009 10:25 AM

Quote:

Originally Posted by mlvpf (Post 348522)
Thanks, arvsinha. I followed ur instructions and produced the txt file but could not proceed using the the tab2opf.py script to convert the txt file. Can you (or anybody) please give step-by-step instruction or assist by ulpoading ready made script with instruction. I'm not knowledgeable in programming.:help:

Once you have the txt file in the folder. Now, get tab2opf.py and Mobigen.exe into the same folder.
Now fire up the command line interface of Windows XP - Go to start > Run > cmd
Change directory to the folder containing the file (all files namely - tab2opf, text file of the dictionary and mobigen) - using the cd command.
Then give the following command -
tab2opf textfile.txt
This should give you a textfile.opf file.
Now in the same command prompt, give the following command - mobigen.exe textfile.opf
Hopefully this should give the mobipocket book file.

Dabon 03-03-2009 04:58 AM

Thanks a million, Arvsinha!!
Great learning experience!!!
From now on, I will try to convert most of my my ebooks into mobipocket format to be able to take full advantage of the great dictionaries and Thesaurus I was able to create...

Take good care,

Dabon.

Nate the great 03-28-2009 03:08 PM

I'm going to move this to Workshop.

kaas 04-03-2009 06:39 AM

A great source for dictionary files and dozens (!!!) of supported languages:

http://xdxf.revdanica.com/down/index.php

you can download them directly as stardict files

cheers,

kaas

Kravejs 08-29-2009 10:31 AM

I have prepared two Esperanto-Russian dictonaries for Mobipocket:
http://code.google.com/p/ervo/
http://code.google.com/p/erv/

visitor 09-20-2009 05:07 PM

I tried to decompile stardict-koreanDic-2.4.2 from
but unfortunately I always crashed by using stardict-editor
on ModName: ntdll.dll ModVer: 5.1.2600.5755 Offset: 0000100b
I am asking here you guys your help to decompile for me this dic to dic.txt.

Thank you..

Solved...cheers

shamanNS 02-06-2010 06:34 PM

Hi. I would like to make english 2 serbian .mobi dictionary from StarDict found at http://downloads.sourceforge.net/xdx...-2.4.2.tar.bz2 ,to be used on my Kindle 2 international and have support for quick look up.
But Stardict editor would not start on my Windows 7,error mentions "libglib-2.0.0.dll" file missing. So I was wondering if someone would be kind to convert the above StartDict to that tab delimited txt file (or ideally opf file,so I don't have to download Pyton,because I'm currently abroad and on dial up connection :( ) and email it to me ( predrag_djokic@yahoo.com )? I would be most grateful to the person willing to do that.

shamanNS 02-21-2010 12:28 PM

No one? :(

sam228 03-13-2010 02:35 AM

I get the same error "libglib-2.0.0.dll" as shamanNS and I have windows Xp. I was wondering if someone could please convert the following German-English dictionaries for use on Kindle and send me by ema*l:
patricksarmad2@gmail.com
1. http://downloads.sourceforge.ne/xdxf...er_eng.tar.bz2
2. http://prdownloads.sourceforge.net/s...r.bz2?download
3. http://prdownloads.sourceforge.net/s...r.bz2?download

miquele 05-19-2010 04:57 PM

I created a Spanish-English dictionary based on the StarDict files.

http://www.4shared.com/file/Ux4eAqzc...h-english.html

Thanks a ton for all the help, it worked after I figured following out:

Copy the StarDict-Editor to
C:\Program Files\Common Files\GTK\2.0\bin
(or similar, where the .dll are).

Before creating the .mobi file with the mibogen.exe, make sure that you change the input language.

Newby 05-20-2010 04:11 AM

is there any, kind of, database of the accessible look up dictionaries in prc format


All times are GMT -4. The time now is 11:09 PM.

Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.