1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
|
By default, dictd searches all dictionaries listed in the
configuration file, and returns all definitions found. This is
usually satisfactory, but sometimes a user may want to search over
some but not all of the available databases.
One solution is for the server to provide "virtual" databases
which merge several of the regular databases into one. For example a
virtual database may be provided which includes all of the translating
dictionaries, or all of the computer-related dictionaries.
The script dictfmt_virtual (provided in the dictfmt package) may
be used to create virtual dictionaries (see dictfmt_virtual(1)).
virtual dictionaries are placed in the dictd.conf file in the same way
a real dictionaries, but the dictd directive "database_exit" should be
placed in the configuration file to prevent multiple searches of the same
dictionaries.
The dictdconfig script will insert virtual dictionaries and the
"database_exit" directive in /var/lib/dictd/db.list as specified in
/etc/dictd.order.
Alternatively, a virtual dictionary may defined in the
configuration file ) see "Virtual Database Specification" in
dictd(8). In this case, the virtual definition must be manually
inserted into the database section of dictd.conf on a line
following the "include /var/lib/dictd/db.list" line. dictdconfig may
still be used to incorporate all other dictionaries into the
configuration file.
There are two general ways to use virtual dictionaries. In one
approach, one or more virtual dictionaries are treated as the default.
This is illustrated by /usr/share/doc/dictd/examples/example_virtual.conf.
Another approach is to leave all available dictionaries as the
default set, and several virtual dictionaries, that are omitted from
the default set may be used when restricted searches are desired.
This is illustrated by
/usr/share/doc/dictd/examples/example_virtual2.conf.
Various combinations of the above approaches may be used. The
important thing to remember is that all dictionaries (real and
virtual) before the database_exit directive are searched by default.
The database_exit directive may also be used without virtual
dictionaries. For instance, all general dictionaries may be listed
first, followed by database_exit, with the other dictionaries
following. These other dictionaries may be accessed with the -d
option to dict.
Robert D. Hilliard <hilliard@debian.org>, 15 March, 2003
|