What is JDictd?

JDictd is a set of Java programs that implement the Dictionary Server Protocol (DICT) as specified in RFC 2229. It is used to access dictionary definitions from a set of natural language dictionary databases. The software (including binaries and source code) is distributed the terms of the GNU General Public License.

To use JDictd you need the Java Runtime Environment (JRE) version 1.1 or higher to run it. Also, you need to get the databases you would like to use. A list of freely available dictionary databases can be found on the Website of the DICT Development Group. (Included in the distribution is a small sample dictionary to test that the server is working).

Features

Quick Installation

  1. Download the current version
  2. Unpack it to a directory of your choice.
  3. From that directory, run the following command:

    java -cp jdictd.jar org.dict.server.JDictd data/dict.ini

    (This assumes that you run JDK1.2. If you run JDK1.1, please replace the command 'java' with 'jre'). You should get a message like the following:

    Mon Feb 25 23:49:08 CET 2002: JDictd started at 2628
    Mon Feb 25 23:49:08 CET 2002: HTTP server started at 2626
    
  4. Start your favorite Web browser and open the address http://localhost:2626
    You should see an input form. Enter some word and see the result from the server.
If you get an error message when starting the server, please consult the Trouble-shooting guide. Otherwise the DICT server is up and running. You can access it either by using the Web interface as described above or using one of the available DICT clients (see http://www.dict.org). Included in the distribution of JDictd is a very simple Java client. You can run it as follows:

java -cp jdictd.jar org.dict.server.JDict uranium

You should see the following output:
220 dict.org Ho Ngoc Duc's DICT server 1.2 <1014720519315@dict.org>
250 OK
150 1 definitions found: list follows
151 "uranium" elements "Elements database 20001107": text follows
uranium
Symbol: U
Atomic number: 92
Atomic weight: (231)
...
.
250 Command complete
221 Closing connection
I include in the distribution some scripts to start the server and the clients. On Unix you can run jdictd.sh to start the server and jdict.sh to run the client, on Windows the scripts are jdictd.bat and jdict.bat, respectively. You may need to customize them before running.

Adding further databases

After downloading other dictionary databases you can tell the JDictd server to use them. The simplest way is to put the data and index file into the directory data under the directory where you have JDictd installed, edit the configuration file data/dict.ini, and then (re)start the server. For example, if you want to add the Free Online Dictionary of Computing then you should add the following lines to the config file:
# Free Online Dictionary of Computing
dc.data=foldoc.dict.dz
dc.index=foldoc.index

Lines beginning with # are comments and are ignored. Only two entries are mandatory: the locations of the data file and the index file. If the name of the data file ends with '.dz' then it is assumed that it is in dictzip format, otherwise the flat text format is assumed.

The prefix 'dc' (in 'dc.data' and 'dc.index') will be called database ID. In the following are the options for another database:

# English-Russian Dictionary
er.data=eng-rus.dict.dz
er.index=eng-rus.index
er.morph=org.dict.kernel.EnglishMorphAnalyzer
er.encoding=utf-8
er.inMemory=false
er.use=false
With er.encoding=utf-8 you specify that the database is in UTF-8 encoding. The line er.morph=org.dict.kernel.EnglishMorphAnalyzer tells the server to use the morphological processor for the English language to find the base form of a word when an inflected form is queried but not found in the database. Currently there are 2 basic morph processors for English and French. (The one for French is called org.dict.kernel.FrenchMorphAnalyzer). Normally the whole index file is read into main memory. If you have little RAM you can disable that by adding the option er.inMemory=false. The option er.use=false specifies that the English-Russian Dictionary should not be used. That option is useful if you want to temporarily ignore some dictionaries but dont want to delete or comment out all lines concerning them.

The Dict Servlet

To use a servlet you need a servlet container. If you do not have one, you can download Jakarta Tomcat for free. After installing Jakarta Tomcat, please download the file dict-nn.war and copy it to the directory webapps under your Tomcat installation directory. Now start Tomcat, you should see that Tomcat extracts the file dict.war to a directory called dict under webapps. The dictionary servlet is now ready to use: just point your browser to http://localhost:8080/dict to access it. (8080 is the default port used by Tomcat. If you start it at another port, just change the port nummer in the above address.)

The data files are located in the directory webapps/dict/data. You can add more databases as described above by putting your databases there and edit the configuration file accordingly.

Source code

If you want to modify the programs, you can download the source code. There are virtually no javadoc comments yet, sorry.