DICTFMT(1)

NAME
dictfmt - formats a DICT protocol dictionary database

SYNOPSIS
dictfmt  -c5|-e|-f|-h|-j|-p  -u  url -s name  basename

DESCRIPTION
dictfmt takes a file, FILE, on stdin, and creates a dictionary database named basename.dict, that conforms to the DICT protocol. It also creates an index file named basename.index. ( basename is commonly chosen to correspond to the basename of FILE , but this is not mandatory.) Unless the database is extremely small, it is highly recommended that basename.dict be compressed with /usr/bin/dictzip to create basename.dict.dz. (dictzip is included in the dictd package.)

FILE may be in any of the several formats described by the format options -c5,-e,-f,-h,-j, or -p. Exactly one of these options must be given.

Headers are prepended to the file giving the URL of the site from which the original database was obtained, and the name of the dictionary. If the -u and/or -s options are omitted, the value "unknown" will be included in these headers, which is undesirable. A header giving the date of conversion is also added.

OPTIONS

-c5 FILE is formatted with headwords preceded by 5 or more underscore characters (_) and a blank line. All text until the next headword is considered the definition. If the headwords are all caps, they are changed to mixed case. Any leading `@' characters are stripped out, but the file is otherwise unchanged. This option was written to format the CIA WORLD FACTBOOK 1995.

-e  FILE is in html format, with the headword tagged as bold. (<B>headword - </B>)
    This option was written to format EASTON'S 1897 BIBLE DICTIONARY. The head of a typical entry from Easton is:

    <A NAME="T0000005">
    <B>Abagtha - </B>
    one of the seven eunuchs in Ahasuerus's court (Esther 1:10; 2:21). This is converted to:
    Abagtha
       one of the seven eunuchs in Ahasuerus's court (Esther 1:10; 2:21). The headword `Abagtha' is indexed. NOTE: This option should be used with caution. It removes several html tags (enough to format Easton properly), but not all. The Makefile for dict-misc uses a sed script to modify certain cross reference tags. It may be necessary to pipe the input file through a sed script, or hack the source of dictfmt in order to properly format other html databases.

-f  FILE is formatted with the headword starting in column 0, followed by a blank line, with the definition indented 8 spaces (or one tab character) on subsequent lines. This option was written to format the FOLDOC.

-h  FILE is formatted with the headword starting in column 0, followed by a comma, with the definition continuing on the same line.
    This option was written to format HITCHCOCK'S BIBLE NAMES DICTIONARY. The headword is indexed; the text of the file is not changed.

-j  FILE is formatted with headwords surrounded by colons, followed by the definition.
    This option was written to format the JARGON FILE. The colons surrounding the headword are removed, and the headword is indexed. NOTE: Recent versions of the jargon file insert three blanks before the first colon at each headword. These must be removed before processing with dictfmt. (sed scripts have been used for this purpose. ed, awk, or perl scripts are also possible.)

-p  FILE is formatted with `%h' in column 0, followed by a blank, followed by the headword , followed by a line containing `%d' in column 0. The definition starts on the following line. This option was written to format Jay Kominek's elements database.

-u url
    Specifies the URL of the site from which the raw database was obtained.

-s name
    Specifies the name and, optionally, the version and date, of the database. (If this contains spaces, it must be quoted.)

-L  display license and copyright information

-V  display version information

-D  output debuugging information

--help
    display a help message

CREDITS
dictfmt was written by Rik Faith (faith@cs.unc.edu) as part of the dict-misc package, and modified by Robert D. Hilliard <hilliard@debian.org> to be a stand-alone package. It is distributed under the terms of the GNU General Public License. If you need to distribute under other terms, write to the author.

SEE ALSO
dict(1), dictd(8), dictzip(1), http://www.dict.org, RFC 2229