GNU Dico DICT Dictionary Server 2.11 Is Released

From LinuxReviews
Jump to navigationJump to search
Black-and-white-gnu-head.png

GNU dico is a dictionary server for the ancient yet little-known DICT network dictionary protocol from 1997. You can pair the new GNU Dico 2.11 maintenance release, which only adds a few minor bug-fixes, with the release of a new GCIDE English dictionary and setup your very own English-speaking dictionary server.

written by 윤채경 (Yoon Chae-kyung)  2021-04-28 - last edited 2021-04-29. © CC BY

GNU Dico 2.11.jpg
The GNU Dico DICT server v2.11.

The DICT network protocol (dict://) was conceived in the 1990s when the Internet was relatively new and the "world wide web" was in it's infancy. The idea was simple: Let's create a protocol that allows clients to ask servers for a word and get a pure text response explaining what that word is all about.

Sergey Poznyakoff begun creating the GNU Dico server for the DICT protocol in September, 1998. The first public release was made available on November 3rd, 2001.

The world decided that the more advanced and feature-rich Hypertext Transfer Protocol (http://) was a better idea and it become the dominant Internet protocol standard for dictionaries as well as everything else. The DICT network protocol could have become somewhat well-known and used if the major web browsers had implemented support for dict:// (and it would be simple, there is no mark-up, just text). They didn't, and DICT drifted into obscurity.

There are those who refuse to accept the all-compassing Hypertext Transfer Protocol paradigm. Some have invented their own alternative called Gemini, a purely text-based protocol with TLS support and a really simple markup language. Others, like Sergey Poznyakoff, keep on maintaining server software for the good old DICT protocol.

Sergey Poznyakoff has just announced new releases of the GNU Dico dictionary server and the GNU Collaborative International Dictionary of English (GCIDE). The GCIDE dictionary is based on Webster's Revised Unabridged Dictionary. The current version has many additions from WordNet. It is maintained by the GNU Project (mostly Sergey Poznyakoff) who adds corrections and add-ons to it regularly. The new GCIDE 0.53 release is, in the release-notes, described as one that:

"incorporates many fixes that have been reported since previous release."

GCIDE 0.53 release notes

You can combine the latest GNU Dico DICT server with the GCIDE dictionary and create your very own dictionary server like it's still the 1990's.

Start by making a clean directory for your dictionary project and enter into it.

mkdir dictionary-server
cd dictionary-server

Next, fetch the GNU Dico server and compile it. Compiling the GNU Dico 2.11 server (dicod/dicod) is easy, it doesn't seem to depend on anything beyond a compiler and the standard C libraries. You can, optionally, configure it to use GSASL, Guile and LDAP. You don't need any of that if you just want to try it real quick. Just get the code and compile using ./configure && make.

wget  https://ftp.gnu.org/gnu/dico/dico-2.11.tar.xz 
tar xf dico-2.11.tar.xz 
cd dico-2.11/
./configure
make -j$(nproc)
cd ..

You should now have a GNU Dico server in dico-2.11/dicod/dicod and a client in dico-2.11/dico/dicod.

The next step is to acquire the fresh new GCIDE 0.53 dictionary. You will need fetch it and unpack the tarball and create a index file for it using the a tool called idxgcide hidden within the dico-2.11/modules/gcide/ folder. The dico manual does of course tell you that you don't need to run idxgcide but you do since the gcide tarball doesn't come with any index file.

wget https://ftp.gnu.org/gnu/gcide/gcide-0.53.tar.xz
tar xf gcide-0.53.tar.xz
dico-2.11/modules/gcide/idxgcide gcide-0.53

The next step is the hard part: Creating a configuration file. It's hard unless you can cheat by simply using the following configuration file:

File: dicod.conf
load-module gcide;
database {
    name "gcide";
    handler "gcide dbdir=../dictionary-server/gcide-0.53 suppress-pr";
    languages-from "en";
    languages-to "en";
}
mode daemon;
listen :2628;

Why does the database dbdir need to be ../dictionary-server/gcide-0.53, you may wonder. Wouldn't it be in ./gcide-0.53 or just gcide-0.53 if you start dicod from the dictionary-server folder you created where gcide-0.53 resides? Well, you'd be right to think that, but that would be way too simple and you wouldn't have to look at the code to figure out why that does not work if it was that simple.

You can start your database server, once a configuration file is in place, with:

./dico-2.11/dicod/dicod --foreground --load-dir=dico-2.11/modules/gcide  --config=./dicod.conf --stderr

The --load-dir= argument is needed to tell dicod where the modules are. It will, of course, not figure that out on it's own. --foreground prevents it from forking into a background process. That is something you want if you decide to run it all the time, but it's not needed if you just want to play with it. --stderr is not really needed but you should run with it anyway because of all the oddities like having to specify the folder your in with ../foldername.

You can now open another terminal window (since --foreground leaves dico in the foreground) and use good old telnet to connect to Dico on local port 2628:

telnet localhost 2628

That command will connect you to the Dico server using good old telnet. You should get that that glorious 1970's comping feeling once you have a telnet connection to your dictionary server. You can type help to get a list of valid commands. The useful ones are show db, which will hopefully show that you have the gcide database, define database word, because it would make to much sense to let you lookup words in the one database that is available without naming it every time, and quit. Dico is a server for the DICT network protocol, not something you are supposed to use by typing commands into it, so help will tell you that you are supposed to use CAPITAL letters for the commands. You can do that if you want to, though it seems to understand what you mean even if you don't.

You can type define gcide gnu to get information about "large South African antelopes". linux is not defined, nor is there any mention of the GNU project when you ask about gnu.

GNU Dico Defining GNU.jpg
GNU Dico defining GNU using the GCIDE dictionary.

You can also connect using the telnet-like dico client program from the GNU Dico package with:

dico-2.11/dico/dico --host=127.0.0.1

You will have to specify that you want to connect to --host=127.0.0.1 or another server; it will try to look words up at dict://gnu.org.ua:2628 if you don't. That address is hard-coded with DEFAULT_DICT_SERVER = gnu.org.ua in just about every single Makefile within the GNU Dico 2.11 source-tree.

You just have to type the word you are looking for within the dico client. You can also type .help (start with a period .) and .quit and a few other commands.

There are a handful of other programs you can use to access a standard DICT server. It is, after all, a standardized network protocol from 1997. Yet you may have a hard time finding anything that's maintained and still compiles. GNOME Dictionary appears to be the only graphical program that's still maintained. It can be configured to use a DICT server on localhost in the Preferences. KDE used to have something called Kdict. It doesn't look like it was ported from KDE 3.x to KDE 4. You'll have a very hard time compiling the last version on any modern GNU/Linux distribution. The dismal DICT client situation could quickly change if all those making Gemini browsers were to implement the dict:// protocol in addition to gemini://, dict:// is even simpler.

You can find a lengthy manual for dicod with everything except the basic information you need to start it at puszcza.gnu.org.ua/software/dico/manual/dico.html and there is an equally long manual for the dico client at puszcza.gnu.org.ua/software/dico/manual/dico.html.

Tarballs for GNU Dico 2.11 are available in several formats (gz/bz2/xz) at https://ftp.gnu.org/gnu/dico/ and the latest GCIDE dictionary can be acquired in the same variety of formats from https://ftp.gnu.org/gnu/gcide/. Just grab the .xz, it is always the smallest tarball when multiple formats are available.

There is a homepage for GNU Dico at https://puszcza.gnu.org.ua/software/dico/ and a homepage for the GNU Collaborative International Dictionary of English at https://savannah.gnu.org/projects/gcide/. There is even web page where you can use the GCIDE dictionary online at https://gcide.gnu.org.ua/.

0.00
(0 votes)


Add your comment
LinuxReviews welcomes all comments. If you do not want to be anonymous, register or log in. It is free.