Your First DSL Dictionary


Let us create a simple DSL dictionary. We will name it "My first dictionary". This will be an English-Russian dictionary which will contain one card. The card will translate the phrase "my first dictionary" from English into Russian.
You can create a DSL dictionary file in any text editor. We recommend using Notepad for the purpose.

  1. Create a new text file in Notepad or any other text editor. At the very beginning of the new text document, enter the header for the new dictionary.  You can copy the header from this example and then paste it into your document:

    #NAME "My first dictionary"
    #INDEX_LANGUAGE "English"
    #CONTENTS_LANGUAGE "Russian"

    The codes #NAME, #INDEX_LANGUAGE, and #CONTENTS_LANGUAGE must begin a new line each. These codes are followed by one blank space and some text in inverted commas. This text must be provided by the user and means the following. "My first dictionary" is the name of your new dictionary, "English" is the source language of your new dictionary, and "Russian" is its target language.

  2. Now write the text of your new dictionary card. Every dictionary card must have a headword and body. A headword is a word or expression to be translated. It must always be placed at the start of a line (i.e. there must be no other characters or spaces on this line preceding the headword). The body of the card contain a translation, comments, notes or any other information you may wish to include. The body of the card must be placed below the headword and be preceded with a blank space (inserted by pressing the Space button) or a tabulation symbol (inserted by pressing the Tab button). This will enable Lingvo to distinguish the headword from the body text.
    To see how it works, simply copy the sample text given below into your document below the header:

    my first dictionary
        мой первый словарь

  3. Save the dictionary file in Unicode encoding (in the Save As… dialog box, select Unicode in the Encoding drop-down list) and name the file FirstDictionary. Close Notepad or any other text editor you may have used.
  4. Change the extension of the text file to .dsl. (If you do not see the extension of the file, in Windows Explorer, go to Tools>Folder Options, click the View tab and clear the box nest to "Hide extensions for known file types".)
  5. Launch DSL Compiler (Start>All Programs>ABBYY Lingvo 12>DSL Compiler 12).
  6. In the DSL Compiler dialog box that opens, under the Source file properties group, browse to the file FirstDictionary.dsl, which contains the dictionary you created and select the Unicode option below.
    Make sure that the Create dictionary ready for indexing option is selected. With this option selected, DSL Compiler will automatically add the necessary markup to the dictionary (otherwise, this markup must be added manually by the user when creating the text file). Also make sure that the Create error log file (*.dde) option is selected.
  7. Click Compile. If the compilation is successful, the About Dictionary dialog box will open saying that the dictionary has been created successfully. Two files will be created as a result of compilation: a dictionary file called FirstDictionary.lsd and a file called FirstDictionary.dde which logs any errors detected during the compilation.
     
    What shall I do if during the compilation I receive the massage saying that the annotation file was not found?

    Annotation files are optional. They contain general information about a dictionary - its author, number of entries, etc. Our sample dictionary will have no annotation, so just click Yes in the message box that opens and the compilation process will continue.

     

    What shall I do if the program fails to compile the dictionary?

    Compilation may fail due to errors in the file. See the list of errors in FirstDictionary.dde. Correct the errors and repeat the compilation process.

  8. Add the dictionary to ABBYY Lingvo (Tools>Add Dictionary… or simply drag and drop the *.lsd file onto the Lingvo Bookshelf).

 

You have just created your first dictionary, which contains one card, i.e. one dictionary entry. Now that you get the idea how the DSL language and DSL Compiler work, you can start creating larger dictionaries to use in your work and study.

If you compare this sample dictionary with any of the dictionaries supplied with Lingvo, you will notice that the sample card is much less informative: it includes no pronunciation, examples, comments, etc. However, the DSL language allows you to create dictionaries whose appearance and capabilities are similar to the Lingvo dictionaries.

In your new dictionaries you can:

Tips and tricks

http://www.LingvoDA.ru/ - The Web site of the Lingvo Dictionary Association offering a vast collection of free additional dictionaries for Lingvo.

How can I create a dictionary in a different text editor, for example, Microsoft Word?

You can use any text editor, including Microsoft Word, to create the text file of a new dictionary. Just make sure that the text complies with the above requirements, i.e. contains a header which specifies the name of your dictionary and its source and target languages, the headword is placed immediately at the beginning of the line and the body text below is preceded with a blank space or tab character. Once you have typed the dictionary text, you need to save it in TXT format with Unicode encoding. To do this:

If your text editor does not allow you to select Unicode, save the text to TXT format, then open the file in Notepad. Select Save As… on the File menu. In the dialog box that opens, select Unicode in the Encoding drop-down list.

How can I expand and edit DSL dictionaries?

To add new cards or edit a dictionary which has already been compiled and added to ABBYY Lingvo, remove the dictionary from ABBYY Lingvo Bookshelf, open the *.dsl dictionary file which corresponds to the compiled *.lsd file and make the necessary changes. Then recompile the dictionary and add it to the ABBYY Lingvo Bookshelf. More...
New cards can also be created in a separate file which can then be attached to the main dictionary file with the help of the #INCLUDE command. More...

How can I create a dictionary annotation?

Annotations contain general information about dictionaries (i.e. their author, subject, date of creation, etc.). This information can be viewed in ABBYY Lingvo by double-clicking the dictionary icon on the Bookshelf. We recommend using Notepad to create annotation files. The name of the annotation file must be the same as the name of the dictionary it refers to. Save the file in Unicode, and then change the extension of the file to .ann. During compilation, this file will be used by DSL Compiler to add an annotation for your dictionary.