dictd

From ArchWiki
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

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. One of which is: GoldenDict.

Configuration

Locale

By default, dictd comes configured to use the en_US.UTF-8 locale. If your system does not have this locale compiled, dictd 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.

FreeDict provides dictionaries compatible with dictd and are available through the Arch User Repository.

As an example, the dict-freedict-eng-spaAUR package installs an English-Spanish dictionary.

After installation, in order to access the newly installed dictionary, start the dictd.service.

And now the English-Spanish dictionary can be queried by executing:

$ dict 
Tip:
  • A list of all the available dictionaries can be queried by executing:
$ dict -I
  • To query a specific dictionary database, you can use the -d flag. To query the English-Spanish database, for example, for the word "free" you can use:
$ dict -d eng-spa free

Installing Additional Dictionaries

Additional dictionaries are available in the Arch User Repository through the search term dictd. For example, dict-wnAUR is an English-English dictionary.

After installing the new dictionaries, make sure to restart the dictd.service to refresh the available dictionary databases.

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.