3.5.3. Lexicons

The main purpose of the Lexicon Component in ELAN is to support the (semi-automated) interlinearization process. It is not intended as a full-fledged lexicon tool, though the data model supports a bit more than strictly necessary for its main purpose. The data model and XML-based data format are similar to the LIFT format (Lexicon Interchange Format)), but simplified. These are the main fields of a lexical entry:

The main field is lexical-unit (equivalent to lemma, headword, the primary lexical form). morph-type indicates the word part (e.g. stem, prefix, suffix), analyzers can use this information when processing the input text. The grammatical-category field is the category of the lexical item, the part of speech. The Edit Entry window shows which other fields can be added at the moment. (The data model defines more fields than visible in the entry window, but support and documentation hereof is still pending.) The user can add custom fields at the level of the entry and at the level of sense, these will be visible as field: name.

In the lexicon panel of the interlinearization mode the contents of lexicons can be displayed, one lexicon at the time. But it is possible to store and manage multiple lexicons on disc and choose which one to display. The leftmost drop-down box above the table lists all lexicons that have created or imported.

The list of available lexicons

Figure 3.34. The list of available lexicons


If a lexicon has been selected and is displayed in the panel, lexical entries can be added, edited or removed.

Lexicon overview

Figure 3.35. Lexicon overview


The lexicon overview can be adjusted to display or hide certain columns. To do so, you have to right-click on a lexical entry to display the context-menu. From there, you can show or hide columns of the lexicon. Some fields can occur more than once in an entry (like variant or gloss), these will be displayed in a single cell, each value surrounded by square brackets. The context menu also has Add, Remove and Edit items, which have the same function as the buttons below the table (see Section 3.5.3.2).

Lexicon context-menu

Figure 3.36. Lexicon context-menu


The order of the entries in the table can be changed by clicking on any of the column headers, a little arrow indicates whether the items are sorted in ascending or descending order.

3.5.3.1. Creating & editing lexicons

Actions for creating and editing lexicons are available in the Lexicon Actions drop-down menu. The actions always apply to the lexicon that is selected in the lexicons list and visible in the table. The actions will be discussed below.

The Lexicon Actions

Figure 3.37. The Lexicon Actions


  • The Open Lexicon Editor Window... option opens a separate window for editing lexicons and lexical entries. Especially when multiple modifications are intended, this is more convenient than the one-time use entry edit dialogs described in Section 3.5.3.2. The separate Lexicon Editor is described in section Section 3.5.3.3.

  • To create a new lexicon from scratch choose Create New Lexicon.... A new dialog will appear, allowing you to fill out details about your new lexicon.

    Create New Lexicon dialog

    Figure 3.38. Create New Lexicon dialog


    When the details have been filled out (a Name and a Language are required), click Apply to create the lexicon. The lexicon file will be stored in a predefined folder labeled LexanLexicons inside the Section 1.1.2. The file name is based on the name of the lexicon and the file extension is .xml.

  • The Open Lexicon... option allows to open a lexicon that is already in the native format but is in a different folder. The lexicon file is then copied to the LexanLexicons folder. So, this action behaves like an import function for lexicons that don't need to be converted (e.g. a file that has been shared by a colleague).

  • The Close Lexicon option closes the current lexicon, the table will be cleared and No Lexicon will be selected.

  • The Save Lexicon action updates the corresponding file in the default location, if there have been any changes in the lexicon.

  • The Save Lexicon as... option allows to save the lexicon somewhere else in the same file format, e.g. for the purpose of creating a back up file. This action is similar to the export functions but then in the native format.

  • The Save Lexicon with Current Entry Order option saves the lexicon with the entries sorted as they are visible in the table of lexical entries (the lexicon framework doesn't allow to specify a custom sort order yet).

  • The Edit Lexicon Properties... option opens a window similar to the Create New Lexicon dialog, the properties that have been entered before can be updated or completed here. But there are two additional tabs, Custom Fields and Sort Order, described below. Click the Apply button to apply the changes to the lexicon.

    The Edit Lexicon Properties window

    Figure 3.39. The Edit Lexicon Properties window


    The Custom Fields tab

    Figure 3.40. The Custom Fields tab


    The Custom Fields tab allows to specify the names of custom fields (at the level of entry or sense or both) to be used in lexical entries of this lexicon.

    The Sort Order tab

    Figure 3.41. The Sort Order tab


    In the Sort Order tab a preferred sort order can be specified by entering an ordered list of tokens consisting of one or more characters. The sort order will be applied to the lexical-unit field but also for the variant and citation fields. After changing the sort order it might be necessary to click the header of the lexical-unit column once to enforce re-sorting of the table.

    [Note]Note

    It is advised to use the Save Lexicon with Current Entry Order option to apply the new sort order to the underlying data structure as well (not only to the view). After that, new lexical entries will be inserted according to the custom sort order.

  • The Import Lexicon... option opens a file browser window that allows to select either a Toolbox lexicon (.dic, .db, .txt), a lexicon in LIFT format (.lift) or a CorpAfroAs lexicon (.eafl). In case a Toolbox file has been selected, a configuration window will be shown (see below), otherwise a converter will import as much as possible from the original lexicon data into an ELAN lexicon and will add the new lexicon to the list of lexicons.

    Import Toolbox dictionary

    Figure 3.42. Import Toolbox dictionary


    This window allows to specify mappings from Toolbox field markers to ELAN lexicon entry fields. The main element in the window is a tabel with in the first column the list of markers that have been found in the Toolbox dictionary file. In the second column the corresponding field name can be selected from a list or a custom field name can be entered (either custom-field-name or sense/custom-field-name). For some fields it will be possible to enter a language code in the third column, depending on the value in the second column. Markers that don't have a mapping in the second column will be ignored during the import process.

    Other elements in this configuration window are:

    • The Lexicon Name text field allows to enter a name for the lexicon. A name is required, it is also used for the file name of the lexicon.

    • The Show raw field names in table checkbox only has an effect on how field names appear in the table, as friendly name or as their raw equivalents from the lexicon XML file.

      Import Toolbox dictionary showing "raw" field names

      Figure 3.43. Import Toolbox dictionary showing "raw" field names


    • The Split semicolon separated fields into multiple fields option requests the import function to produce multiple fields from a single input field, if the input contains one or more semicolon characters and if the target field is allowed to appear more than once in an entry (e.g. the input has multiple gloss values separated by semicolons).

    After clicking the OK button several warning messages might be shown, e.g. if required information is missing, if a required field has not been selected in the second column (e.g. lexical-unit) or if a field has been selected more often than allowed.

  • The Export Lexicon... action only supports conversion to LIFT format.

[Note]Note

There is currently no Undo/Redo mechanism for lexicon edit actions!

[Note]Note

If multiple transcription windows are open, using the same lexicon, modifying the lexicon should preferably be done in only one window. On Windows there is no guarantee that all windows are updated correctly after a change in a lexicon made in a different window!

[Note]Note

More documentation about the structure of lexical entries, about which fields are required, what is hard-coded etc. will follow. The same for native, import and export formats etc.

3.5.3.2. Editing lexical entries

After creating or importing a lexicon, lexical entries be added, edited or removed. Adding a new entry can be started by clicking the Add button on the bottom of the Lexicon main panel or by choosing the Add menu item from the context menu, if there are already entries in the table. A new dialog will appear, allowing to create a new entry by entering values for, at least, the required fields.

Add a Lexical Entry

Figure 3.44. Add a Lexical Entry


When you are finished, click Apply to add the entry to the lexicon. Required fields will be highlighted if you click Apply while not all required fields are filled in.

Editing a lexical entry can be done by either clicking the Edit button on the bottom of the panel, by right-clicking the entry and choosing Edit from the context-menu or by double-clicking the entry in a cell that can not be edited directly in the table (i.e. the lexical-unit field or any field of which there can be more than one). A dialog will open, displaying the chosen lexical unit as a tree structure. Some general information is shown, such as ID and date of creation.

Edit a lexical entry

Figure 3.45. Edit a lexical entry


  • To edit the entry, click on the value that you would like to add or change or press TAB to select the first editable field. It will become active and ready for editing, a dark blue border will highlight it. Hitting the TAB key accepts the value of the current field and activates the next field.

  • The fields that are displayed in a dark grey color are so-called placeholders: these fields are not yet there, but can be created. When activating such field the + button can be clicked to add the field to the entry and to make the text field editable.

  • In general when activating a field + or - buttons can be present and can be enabled or greyed out, depending on whether more fields of that type can be added or if that field can be deleted. Pressing the + or = keyboard key triggers the Add Field action, the - key the Remove Field action.

  • When a field is removed it will still be shown in the entry, but in a red color.

  • Changes will only be applied to the entry in the lexicon after clicking the Apply button or pressing the ENTER key.

  • Changes can be discarded by clicking the Cancel button or pressing the ESC key or the CTRL+W combination.

Removal of a lexical entry is done by highlighting the entry in the lexical entries table and then either clicking the Remove button on the bottom of the Lexicon panel, or by right-clicking the entry and choosing Remove from the context-menu.

3.5.3.3. The Lexicon Editor

The Lexicon Editor combines the editing actions described in the previous sections in a separate, blocking window. The window is split in two with on the left side the same lexical entry table as in the main window and on the right side the lexical entry editor.

The Lexicon Editor window

Figure 3.46. The Lexicon Editor window


The menu bar has three menus:

  • The File menu holds most of the lexicon Open, Save and Import/Export actions that are described in Section 3.5.3.1

  • The Edit menu currently only contains the Edit Lexicon Properties item.

  • The View menu lists the available lexicons. Selecting a lexicon here will load it and fill the Lexical Entries table with its entries.

    The Lexicon View menu

    Figure 3.47. The Lexicon View menu


The left panel shows the name of the current lexicon at the top, with visual highlighting when there are unsaved changes to the lexicon. The lexical entry table covers most of the space, it has the same column showing/hiding and sorting mechanisms as mentioned above. A single click on an entry loads the entry in the entry edit panel to the right. The UP and DOWN keys select the entry in the previous or the next row and loads it. The Add button creates a new entry and loads it. The required fields in an entry are filled with template text, to be modified by the user.

A new lexical entry

Figure 3.48. A new lexical entry


Navigation from one field to the next is again performed with the TAB key, the ENTER key applies the current changes to the entry. If another entry is selected and loaded, changes in the current entry will be applied without a prompt.

[Note]Note

If there are multiple ELAN windows open with the same lexicon visible, it might be necessary to reload the lexicon in those windows to see the modifications made in the Lexicon Editor.

Filtering the lexical entries

Figure 3.49. Filtering the lexical entries


It is possible to filter the entries in the table by entering a search string in the Filter Entries text field and pressing Enter. The input is treated as a regular expression. The filter can either be applied to all visible columns or to a single column, selected in the Column drop down box. This allows, for example, to only show the entries with a citation form starting with a 'c'. The filter can be removed again by clicking the Reset button and all entries will be listed again.