DICTFMT(1)
β¨ NAME β¨
dictfmt β she formats a DICT protocol dictionary database, and she does it flawlessly π
π¦ SYNOPSIS π¦
dictfmt -c5|-t|-e|-f|-h|-j|-p [options] basename
dictfmt -i|-I [options]
π DESCRIPTION π
okay so bestie, listen up, because this is actually so useful π«Ά
dictfmt grabs a file, FILE, from stdin, and spins up a dictionary database called basename.dict that conforms to the DICT protocol. She also makes you an index file called basename.index. By default the index is sorted according to the C locale, and literally only alphanumeric characters and spaces get used in the sorting β but you can change all of that with the --locale and --allchars options. (Also, basename is usually picked to match the basename of FILE, but that's not mandatory, so do your thing π)
Unless the database is extremely small, it is highly recommended thatbasename.dictbe compressed with/usr/bin/dictzipto createbasename.dict.dz. (dictzipships inside the dictd source package, iykyk.)
FILE can be in any of the several formats described by the format options -c5, -t, -e, -f, -h, -j, -p, -i or -I. Exactly one of these options must be given. one. not two. one. π
dictfmt prepends several headers to the .dict file. The 00-database-url header gives the value of the -u option as the URL of the site from which the original database was obtained. The 00-database-short header gives the value of the -s option as the short name of the dictionary. (This "short name" is the identifying name given by the dict -D option.) If the -u and/or -s options are omitted, these values will show up as "unknown", which is undesirable for a publicly distributed database β so don't do that to yourself π
The date of conversion (formatting) is given in the 00-database-info header. All text in the input file prior to the first headword (as defined by the appropriate formatting option) gets appended to this header. All text in the input file following a headword, up to the next headword, is copied unchanged to the .dict file. periodt π
π FORMATTING OPTIONS π
Pick exactly one of these, bestie. This is the main character decision of the whole operation.
-c5βFILEis formatted with headwords preceded by 5 or more underscore characters (_) and a blank line. All text until the next headword counts as the definition. Any leading@characters get stripped out, but otherwise the file is untouched. This option was written to format the CIA WORLD FACTBOOK 1995 π₯-tβ the-c5,--without-infoand--without-headwordoptions are implied. Use this one if your input database comes from thedictunformatutility.-eβFILEis in html format, with the headword tagged as bold. (<B>headword - </B>)
This option was written to format EASTON'S 1897 BIBLE DICTIONARY. 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 heading <A NAME="T0000005"> is omitted, and 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 of them. The Makefile that was originally written to formatdict-eastonuses sed scripts to modify certain cross reference tags. It may be necessary to pipe the input file through a sed script, or hack the source ofdictfmtin order to properly format other html databases. so like, be careful πΈ
-fβFILEis formatted with the headwords starting in column 0, with the definition indented at least one space (or tab character) on subsequent lines. The third line starting in column 0 is taken as the first headword, and the first two lines starting in column 0 are treated as part of the00-database-infoheader. This option was written to format the F.O.L.D.O.C.-hβFILEis formatted with the headwords starting in column 0, followed by a comma, with the definition continuing on the same line. All text before the first single character line is included in the00-database-infoheader, and lines with only one character are omitted from the.dictfile. The first headword is on the line following the first single character line. The headword is indexed; the text of the file is not changed. This option was written to format HITCHCOCK'S BIBLE NAMES DICTIONARY.-jβFILEis formatted with headwords starting in col 0, enclosed in colons, followed by the definition. The colons surrounding the headword are removed, and the headword is indexed. Lines beginning with*,=or-are also removed. All text before the first headword is included in the headers. This option was written to format the JARGON FILE.
NOTE: Some recent versions of the JARGON FILE had three blanks inserted before the first colon at each headword. These must be removed before processing withdictfmt. (sed scripts have been used for this purpose.ed,awk, orperlscripts are also possible.) no cap π
-pβFILEis formatted with%hin column 0, followed by a blank, followed by the headword, optionally followed by a line containing%din column 0. The definition starts on the following line. The first line beginning%hand any lines beginning%dare stripped from the.dictfile, and%his stripped from in front of the headword. All text before the first headword is included in the headers. The second line beginning%his taken as the first headword. This option was written to format Jay Kominek's elements database β-i,-Iβ These two options are different from all the other formatting options. They're meant to resort (according to dictd requirement) an.indexfile given on stdin. That is, the.dictfile is not generated at all. Only resorting is done. A three- or four-column.index-like input is expected.-iexpects decimal offset and length, while-Iexpects them in base64 format. π
π OPTIONS π
the glow-up section, bestie β¨
-uurl β Specifies the URL of the site from which the raw database was obtained. If this option is specified, the00-database-urlheadword and its appropriate definition will be ignored.-sname β Specifies the name and, optionally, the version and date, of the database. (If this contains spaces, it must be quoted.) If this option is specified, the00-database-shortheadword and its appropriate definition will be ignored.-Lβ display license and copyright information π-Vβ display version information-Dβ output debugging information π--helpβ display a help message--localelocale β Specifies the locale used for sorting. If no locale is specified, the"C"locale is used. For using UTF-8 mode,--utf8is needed.--8bitβ generates database in 8-bit mode, see the--localeoption also.
Note: This option is deprecated. Use it for creating 8-bit (non-UTF8) dictionaries only. In order to create a UTF-8 dictionary, use the --utf8 option instead. don't be doing deprecated things, it's not the vibe π
--utf8β If specified, a UTF-8 database is created. π¦--allcharsβ Specifies that all characters should be used for the search, because by default only alphabetic, numeric characters and spaces are put into the.indexfile and therefore are used in search. Creates the special entry00-database-allchars.--case-sensitiveβ makes the search case sensitive. Creates the special entry00-database-case-sensitive.--headword-separatorsep β sets the headword separator, which allows several words to have the same definition. For example, if--headword-separator %%%is given, and the input file containsautumn%%%fall, bothautumnandfallwill be indexed as headwords, with the same definition. iconic, honestly π--index-data-separatorsep β sets the index/data separator, which allows you to set the first and fourth columns of the.indexfile independently. That is, the first column can be treated as an index column (where theMATCHcommand searches) and the fourth column as a result column (where theMATCHgets things to be returned), and they (1-st and 4-th columns) are completely independant of each other. The default value for this separator is the ASCII symbol" \034".--break-headwordsβ multiple headwords will be written on separate lines in the.dictfile. For use with--headword-separator.--index-keep-origβ When--utf-8is specified, headwords are lowercased and non-alphanumeric characters are removed from them before saving to the.indexfile, in order to simplify the search. When the--index-keep-origoption is used, a fourth column is created (if necessary) in the.indexfile, and it contains an original headword which is returned by theMATCHcommand. This option may be useful to prevent converting" AT&T"to" ATT"or to keep proper nouns with an uppercased first letter. π--without-headwordβ headwords will not be included in the.dictfile--without-headerβ the header will not be copied to the DB info entry--without-urlβ the URL will not be copied to the DB info entry--without-timeβ the time of creation will not be copied to the DB info entry--without-verβ By defaultdictfmtcreates a special entry00-database-dictfmt-X.Y.Zthat contains (in the.dictfile) thedictfmtversion in the formatdictfmt-X.Y.Z. This option suppresses that. π--without-infoβ the DB info entry will not be created. This may be useful if the00-database-infoheadword is expected from stdin (dictunformatoutputs it).--columnscolumns β By defaultdictfmtwraps strings read from stdin to 72 columns. This option changes that default. If it is set to zero or a negative value, wrapping is off. π§--default-strategystrategy β Sets the default search strategy for the database. It will be used instead of strategy'.'. The special entry00-database-default-strategyis created for this purpose. This option may be useful, for example, for dictionaries containing mainly phrases but the single words. In any case, use this option if you are absolutely sure what you are doing. π--mime-headermime_header β When a client sends theOPTION MIMEcommand to thedictd, definitions found in this database are prepended by the specified MIME header. Creates the special entry00-database-mime-header. π
π CREDITS π
ok so dictfmt was written by Rik Faith (faith@cs.unc.edu) as part of the dict-misc package. periodt, that's the origin story π
and bestie, dictfmt is distributed under the terms of the GNU General Public License β iconic licensing behavior fr fr π
lowkey important: if you need to distribute it under other terms, you gotta write to the author. no cap, that's the move π
βοΈ AUTHOR βοΈ
This manual page was written by Robert D. Hilliard <hilliard@debian.org> π (yes, the whole page β main character energy, we love to see it)
π SEE ALSO π
likeβ¦ go read those too bestie, iykyk π¦
ok that's the whole page, we did it π₯³ this manual page is dated 25 December 2000, it's from DICTFMT(1), and honestly? she's a vintage queen and she ate π β¨ bye bestie, go format some dictionaries π«Άπ
π¦ where this page comes from
- arch rolling: dictd 1.13.3-1 Β· GPL-1.0-or-later AND GPL-2.0-or-later
- fedora 43: dictd-server 1.13.3-2.fc43 Β· GPL-2.0-only AND GPL-2.0-or-later AND GPL-1.0-or-later AND GPL-3.0-or-later AND MIT AND BSD-3-Clause AND LicenseRef-Fedora-Public-Domain
- fedora 44: dictd-server 1.13.3-5.fc44 Β· GPL-2.0-only AND GPL-2.0-or-later AND GPL-1.0-or-later AND GPL-3.0-or-later AND MIT AND BSD-3-Clause AND LicenseRef-Fedora-Public-Domain
- nixos 26.05: dictd 1.13.3
- nixpkgs unstable: dictd 1.13.3
- opensuse-leap 16.0: dictd 1.13.1-bp160.1.12 Β· BSD-3-Clause AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND MIT AND SUSE-Public-Domain
- opensuse-leap 16.0: dictd 1.13.1-bp160.1.12 Β· BSD-3-Clause AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND MIT AND SUSE-Public-Domain
- opensuse-leap 16.0: dictd 1.13.1-bp160.1.12 Β· BSD-3-Clause AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND MIT AND SUSE-Public-Domain
- opensuse-leap 16.0: dictd 1.13.1-bp160.1.12 Β· BSD-3-Clause AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND MIT AND SUSE-Public-Domain
- Copyright 2000 Robert D. Hilliard <hilliard@debian.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms