.TH HDICT 1
.SH NAME
hdict \- lookup word in dictionary
.SH SYNOPSIS
.B hdict
[
.B -DIMvq
] [
.B -a
.I addr
] [
.B -d
.I lexicon
] [
.B -i
.I lexicon
] [
.B -m
.I strategy
] [
.IR word
]
.SH DESCRIPTION
.I Hdict
queries a dictionary server using the protocol specified in rfc2229.  A dict server usually has multiple lexicons and can search for a word in the lexicon and return the definition for that word.  A dict server has a list of lexicons to search in by default and has a default searching strategy.

If a strategy has been specified with
.BR -m ,
all matching (lexicon, word)-pairs are returned.
Otherwise, definitions are returned.  If a lexicon has been specified with
.B -d ,
definitions for all matching words in that lexicon are returned.

By default, only exact matches are returned and only the definitions in the first queried database that has definition.

.TP
.B -D
List lexicons available at the server.
.TP
.B -I
Print information and statistics about server.
.TP
.B -M
List matching strategies the server is able to execute.
.TP
.B -v
Be verbose, prints protocol messages to standard error.
.TP
.B -q
If matching is done, with the
.B -m
flag, print only the matching lexicon and word for each hit.  By default, a command is printed that retrieves the definition when run.
.TP
.BI -a " address"
Address of server to connect to.  Default is
.IR tcp!dict.org!2628 ,
which contains many free dictionaries.
.TP
.BI -d " lexicon"
Search only in
.IR lexicon .
Note that the dict protocol specifies special lexicon names: ``!'' searches in all default lexicons (as configured at the server) until the first hit has been found.  ``*'' searches in all default lexicons and continues searching when hits have been found.  ``!'' is used when no database is specified.
.TP
.BI -i " lexicon"
Print information about
.IR lexicon .
.TP
.BI -m " strategy"
Use
.I strategy
for searching.  Common strategies include
.IR exact ,
.IR prefix ,
.IR substring ,
.IR suffix ,
.IR regexp ,
.IR soundex and
.IR lev .
By default, for each hit a command is printed that retrieves the definition when run.  Use
.B -q
for only printing the lexicon and word.
.SH SOURCE
.B /appl/cmd/hdict.b
.SH SEE ALSO
.IR lexicon (2)
.PP
``A Dictionary Server Protocol'', rfc2229.
.SH CAVEATS
Many `features' from the specification are unsupported.  These include
authentication, MIME responses, dict URL's, command pipelining and
extensions.
