How to create your own dictionaries.

First, read src/tools/DICTFILE_FORMAT.

Second, download the source code tarball and compile it, you will find many tools at src/tools/. In windows, you can find the BuildDict.exe file after you installed StarDict.

In most case, I recommend the "tabfile" converter to create your own dictionaries. You need to create a text file first, it should be encoded in UTF-8, and the new line characters should be "\n", if it is in DOS file format("\r\n"), you can use "dos2unix" to convert it.

Here is a example dict.tab file:
============
a	1\n2\n3
b	4\\5\n6
c	789
============
It means: write the search word first, then a Tab character, and the definition. If the definition contains new line, just write \n, if contains \ character, just write \\.

Then use "tabfile" to compile it:
./tabfile dict.tab
You will find two files that are generated by tabfile: "dict.tab.dict" and "dict.tab.idx", then you can compress the "dict.tab.dict" file by dictzip:
dictzip dict.tab.dict
You will get the "dict.tab.dict.dz" file. You can find dictzip at DICT project, http://www.dict.org, just download its source code tarball and compile it, then you can find "dictzip" in it.

At last, create the dict.tab.ifo file by yourself, you can use gedit to edit this file, and you can look at the "src/tools/example.ifo" file for a example. Use "ls -l dict.tab.idx" to get the idxfilesize.

Now you can create a directory at /usr/share/stardict/dic/, for example:
mkdir /usr/share/stardict/dic/example-dict/
And move dict.tab.dict.dz, dict.tab.idx, dict.tab.ifo into this directory:
mv dict.tab.dict.dz dict.tab.idx dict.tab.ifo /usr/share/stardict/dic/example-dict/

It is suggested that you verify this dictionaries at last by:
./stardict_verify /usr/share/stardict/dic/example-dict/dict.tab.ifo

Run StarDict and you will find the dictionary that created by yourself. If you want to distribute your dictionary at StarDict website, just contact me.

Hu Zheng <huzheng_001@163.com>
http://forlinux.yeah.net
2006.3.20
