GNU Dico Manual (split by node):   Section:   Chapter:FastBack: Modules   Up: Modules   FastForward: Interface   Contents: Table of ContentsIndex: Concept Index

5.2 Dictorg

The dictorg module supports dictionaries in the format designed by DICT development group (http://dict.org). Lots of free dictionaries in this format are available from the FreeDict project.

A dictionary in this format consists of two files: a dictionary database file, named name.dict or name.dict.dz (a compressed form), and an index file, which lists article headwords with the corresponding offsets in the database. The index file is named name.index. The common part of these two file names, name, is called the base name for that dictionary.

An instance of the dictorg module is created using the following statement:

load-module inst-name {
    command "dictorg [options]";
}

where square brackets denote optional part. Valid options are the following:

dbdir=dir

Look for databases in directory dir.

show-dictorg-entries

Dictorg entries are special database entries that keep some service information, such as database description, etc. Such entries are marked with headwords that begin with ‘00-database-’. By default they are exempt from database look-ups and cannot be retrieved using MATCH or DEFINE command.

Using show-dictorg-entries removes this limitation.

sort

Sort the database index after loading. This option is designed for use with some databases that have malformed indexes. At the time of this writing the ‘eng-swa’ database from FreeDict requires this option.

Using sort may considerably slow down initial database loading.

trim-ws

Remove trailing whitespace from dictionary headwords at start up. This might be necessary for some databases.

The values set via these options become defaults for all databases using this module instance, unless overridden in their declarations.

A database that uses this module must be declared as follows:

database {
    handler "inst-name database=file [options]";
    ...
}

where inst-name is the instance name used in the load-module declaration above.

The database argument specifies the base name of the database. Unless file begins with a slash, the value of dbdir initialization option is prepended to it. If dbdir is not given and file does not begin with a slash, an error is signalled.

The options above are the same options as described in initialization procedure: show-dictorg-entries, sort, and trim-ws. If used, they override initialization settings for that particular database. Forms prefixed with ‘no’ can be used to disable the corresponding option for this database. For example, notrim-ws cancels the effect of trim-ws used when initializing the module instance.

GNU Dico Manual (split by node):   Section:   Chapter:FastBack: Modules   Up: Modules   FastForward: Interface   Contents: Table of ContentsIndex: Concept Index