New dictionary files for Plan 9's dict(7)

This page contains a patch for Plan 9's dict(7) dictionary browser to allow one to use the dictd free dictionary files (in a slightly modified format).

Dictd is a dictionary software for Lunix which has gathered enough momentum recently to make it barely usable as a general cross-language dictionary. Fortunately Plan 9 already includes capabilities to search through dictionary files in the form of dict(7), so all we need to do is write the glue that makes dict understand dictd files.

Available here:

Patches (note, if this gets into sources i'll remove this section and leave only the dictionary files and intructions):

The following tar archive adds ability to read flat dictionary files to dict(7). It also fixes a small problem with the mkfile -- it doesn't clean mkindex properly and it appears on compiled for the last architecture that the system was recompiled for (MIPS, as of this writing).

You can safely unarchive this in /sys/src/cmd/dict (or your equivalent thereof) and type mk; mk install. This adds support for bulgarian/english and english/bulgarian dictionaries. You need to edit utils.c and recompile if you're going to use anything else. Just follow the instructions at the bottom of this page.

The archive contains:

Eng-Bul and Bul-Eng dictionary files. Uncompress in /lib/dict.

Converted dictionary files from Note: those files are not very complete at all, and probably not really ready for everyday use, however they can serve as a starting point for your search -- for example, the (much more complete) bulgarian/english dictionaries above were found after a search among people on IRC who care about linguistics (thanx Pavel Mihaylov ;). NB: I've removed the files below due to space constraints

Note: these were converted by a script. Please report errors and omissions :)

To add one of the above dictionaries just enter it at the bottom of the Dicts structure definition in utils.c. For example, to add wel-eng (Welsh-English) do the following:

Converting a .dz file to a flat file suitable for dict as defined above:

Format of the flat file:

The index file contains a single entry per word point to the offset of the first character of this word from the beginning of the file. Thus the first entry of the file has offset 0, the second has offset 0+length of the first entry, and so on.

The dictionary file contains entries in the following format:

WORD \n                     # beginning of entry, sometimes contains pronounciation
Description \n              # multiline description
Description \n
Description \n
Description \n
\n                          # two empty lines denote end of entry

How to create the index file:

The following program can be used to create index files from dictionaries in the above format. It expects a dictionary file on stdin and outputs the index on stdout:

Last Modified: Sept 21 2003
mirtchovski at gmail