Davar4: MDK - 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).
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.
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_OutputFile=he_en.dic
;if type description of word is not used, you can set to 1. ;this must be set to 0
;specification of main language and sublanguage. We use standard Windows D4_From_PrimaryLanguage=0x0d ;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 ;here you should set title for main direction (from->to) and for opposite direction (to->from)
|
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 |