Davar4: MDK - Preparation of dictionary modules Homepage Help index Previous Next

 
 

Preparation of dictionary modules


Dictionary modules are modules containing word - word translations. In most cases, it contains short phrase or single word. Main idea of dictionary module is that click to word in some other window text will synchronise dictionary, if possible. There is also third column, type of the word, where you can insert one character which describe the dictionary word. For example R for "root" etc..

Dictionary modules are SQLite3 database files. You can also open .dic file in database browser to edit, add or delete records.

 

Convertor program d4dic.exe needs again two files: data.txt and info.txt.

File info.txt contains important definitions of dictionary, names of dictionary for both directions and language definitions.

Most items in info.txt was explained in preparation of book section, please look there too.

File data.txt contains one definition per line:

word (language from) TAB word (language to) TAB optional character(or nothing) NEW LINE (=CR+LF).

 

 


Example3 - HE-EN dictionary as DIC (use of d4dic.exe)

This is an example, which you will find in MDK folder. After compilation of module, you can move prepared dic file to data folder, start Davar4 and open this module.

Now we will pass through info.txt and data.txt files and comment most important parts.

Example of Hebrew - English dictionary (He-En): main direction is He->En, opposite direction (En->He) can be turned by button on the top of the window. Typing in edit field will synchronise nearest word. If you press the enter key, all words which contains text in the edit field are filtered. Wild card characters * and ? can be used in edit field.

 

info.txt file

 

Example of info.txt file used in Example3 - HE-EN dictionary as DIC (blue, bold) , next line (red) is commentary and explanation (not a part of file!). All red commentaries also starts here by ; character - thus you can copy and paste to editor all section below and use it as template for your module.

;THIS FILE MUST BE UTF-8, Little Endian, without Byte Order Mark. New line is CR+LF pair

D4_Version_Major=1
D4_Version_Minor=0

D4_OutputFile=he_en.dic
D4_Abbreviation=He-En
D4_Title=Hebrew-English dictionary
D4_Info=Words in this file was used with kind permission of Ben Stitz, author of RosettaStone software.
D4_Copyright=Max Oerder
D4_URL=http://janeway.tilda.com.au/ben_s/RosettaStone.html

 

;if type description of word is not used, you can set to 1.
;in this case, USE: Type PrimaryLanguage 0x09 and Type SubLanguage 0x00
;this is NOT implemented yet...use value 0!
D4_Type_Unused=0

;this must be set to 0

 

;specification of main language and sublanguage. We use standard Windows
;values expressed by hexadecimal number. This affects sorting of keys in
;module. For English use 0x09 and 0x00, for Hebrew: 0x0d and 0x00 and
;for Greek 0x08 and 0x00. List of all possible values can be found in
;README.TXT for d4dic program and also in MSDN for MAKELANGID macro (also available freely online on Microsoft web)

D4_From_PrimaryLanguage=0x0d
D4_From_SubLanguage=0x00
D4_To_PrimaryLanguage=0x09
D4_To_SubLanguage=0x00
D4_Type_PrimaryLanguage=0x09
D4_Type_SubLanguage=0x00

;here, primary language and sublanguage must be set for words FROM and TO and TYPE (=3rd column)

;values are same as on other modules

;in the example, language from is Hebrew (0x0d and 0x00), language to is English (0x09 and 0x00) and language of type (3rd column) is also English (0x09 and 0x00)

 

D4_Label_From_To=Hebrew-English dictionary
D4_Label_To_From=English-Hebrew dictionary

;here you should set title for main direction (from->to) and for opposite direction (to->from)


 

 

 

 

 

data.txt file

 

In case of dictionary, data.txt has very simple structure:

 

word (language from) TAB word (language to) TAB type character(or nothing) NEW LINE (=CR+LF).

 

Remember, one translation is on one line, words (or phrases) are separated by TAB character (0x09).

Below is starting block of data.txt for He-En dictionary example:

אָב Father
אָב father
אַבָּא daddy, father
אָב, אַבָּא father
אבד perish
אבד destroy
אבד exterminate
אָבַד perish
אִבֵּד destroy