dictd
The official website describes dictd as:
- Client/server software, human language dictionary databases, and tools supporting the DICT protocol (RFC 2229).
Installation
Graphical front ends
There are various graphical applications that can access dictd
through the DICT protocol. One of which is: GoldenDict.
Usage
Dictionaries can be queried by:
$ dict <word>
To query a specific dictionary database, you can use the -d
flag. To query the English-Spanish database, for example, you can use:
$ dict -d eng-spa <word>
Without further configuration, it is likely that dictd will query online databases. See below to set up offline dictionaries.
Configuration
By default, dictd tries to query offline databases first, then online databases. However, offline databases will not be available unless dictd.service
is enabled, with locale properly set up and offline dictionaries installed (see below).
The online mode can be disabled by commenting server dict.org
out in /etc/dict/dict.conf
. Conversely, the offline mode can be disabled by commenting server localhost
out.
Locale
By default, dictd comes configured to use the en_US.UTF-8 locale. If your system does not have this locale compiled, dictd.service
will fail to start without a helpful error message.
It is likely that you want to configure it to use another locale in /etc/conf.d/dictd
:
/etc/conf.d/dictd
DICTD_ARGS="--locale <your locale>"
Hosting Offline Dictionaries
Dictd can be configured to host offline dictionaries using localhost
as the server by enabling dictd.service
.
First, offline dictionaries need to be installed. Dictionaries are available through the Arch User Repository with the search term dictd
. Some popular English dictionaries include:
- dict-gcideAUR - GNU version of the Collaborative International Dictionary of English
- dict-wnAUR - WordNet
- dict-moby-thesaurusAUR - Moby Thesaurus
The FreeDict project also provides many bilingual dictionaries compatible with dictd, which are usually available on AUR.
After installation, restart dictd.service
if needed to access the newly available dictionary. Afterwards, dictionaries can be queried as described above.
- A list of all the available dictionaries can be queried by executing:
$ dict -I
Troubleshooting
Parse Error
The following error:
/etc/dict/dictd.conf:25: syntax error, unexpected $end /etc/dict/dictd.conf:25: #LASTLINE /etc/dict/dictd.conf:25: ^ dictd (yyerror): parse error parse error
Means that dictd
cannot find a dictionary database. These can be added manually to /etc/dict/dictd.conf
. For example:
database eng-spa { data /usr/share/dictd/eng-spa.dict.dz index /usr/share/dictd/eng-spa.index }
Adds the English-Spanish dictionary installed by dict-freedict-eng-spaAUR. For other dictionaries, copy and paste the above database declaration but make sure to change the database name, i.e. eng-spa
, and also change the data
and index
paths above to specify the right files.