dictd

The
official website
describes dictd as:
Client/server software, human language dictionary databases, and tools supporting the
DICT
protocol (
RFC:2229
).
Installation
Install
the
dictd
package.
Graphical front ends
There are various graphical applications that can access
dictd
through the
DICT protocol
:
GoldenDict
— Feature-rich dictionary lookup program supporting multiple dictionary formats.
http://goldendict.org
||
goldendict-git
AUR
gnome-dictionary
— A GNOME application to look up definitions.
https://wiki.gnome.org/Apps/Dictionary
||
gnome-dictionary
xfce4-dict
— A dictionary plugin for the Xfce panel. Similar to Gnome dictionary.
https://docs.xfce.org/apps/xfce4-dict/start
||
xfce4-dict
MATE Dictionary
— MATE application to look up words in dictionary sources. Similar to Xfce Dictionary.
https://github.com/mate-desktop/mate-utils
||
mate-utils
Emacs
— The extensible editor has a built-in dictd client to look up words in a window or while writing.
https://www.masteringemacs.org/article/wordsmithing-in-emacs
||
emacs
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:
/etc/default/dictd
DICTD_ARGS="--locale
your locale
"
Hosting offline dictionaries
Dictd can be configured to host offline dictionaries by
enabling
dictd.service
and dict need to be configured to using
localhost
as the server in
/etc/dict/dict.conf
or
.dictrc
.
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-gcide
AUR
-
GNU version of the Collaborative International Dictionary of English
wordnet-dictd
AUR
-
WordNet
dict-moby-thesaurus
AUR
-
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.
Tip
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-spa
AUR
. 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.