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).
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
java -cp jdictd.jar org.dict.server.JDict uraniumYou should see the following output:
220 dict.org Ho Ngoc Duc's DICT server 1.2 <firstname.lastname@example.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 connectionI 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.
# 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.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=falseWith
er.encoding=utf-8you specify that the database is in UTF-8 encoding. The line
er.morph=org.dict.kernel.EnglishMorphAnalyzertells 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=falsespecifies 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.
dict-nn.warand copy it to the directory
webappsunder your Tomcat installation directory. Now start Tomcat, you should see that Tomcat extracts the file
dict.warto a directory called
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.