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-gitAUR
  • 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.
https://docs.xfce.org/apps/xfce4-dict/start || xfce4-dict
  • dictionary.el Emacs interface to dictd dictionary servers.
https://www.myrkr.in-berlin.de/dictionary || dictionaryAUR

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 out.

Locale

By default, dictd comes configured to use the 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:

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:

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.

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 . 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 . For other dictionaries, copy and paste the above database declaration but make sure to change the database name, i.e. , and also change the and paths above to specify the right files.

gollark: Nothing. Andrew is just being silly.
gollark: ææææ¡¡¡¡
gollark: It ORIGINATED as one, yes.
gollark: æ is NOT A LIGATURE.
gollark: Don't do it. He might be an annoying person.
This article is issued from Archlinux. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.