aboutsummaryrefslogtreecommitdiff
path: root/doc/strat.texi
blob: c8c9a2fccfc99df26a9bcc349e003907886acb0c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
@c This file is part of the GNU Dico manual.
@c Copyright (C) 2012-2019 Sergey Poznyakoff
@c This file is distributed under GFDL 1.1 or any later version
@c published by the Free Software Foundation.
  This appendix summarizes search strategies available for use in Dico
@value{VERSION}.

@table @asis
@item exact
@cindex exact, a strategy
Match words exactly.  This is a built-in strategy.

@item prefix
@cindex prefix, a strategy
Match word prefixes.  This is a built-in strategy.

@item nprefix
@cindex nprefix, a strategy
This strategy is similar to @samp{prefix}, except that it allows the
user to limit the number of returned matches.  If the search term has
the structure @samp{@var{skip}#@var{count}#@var{string}}, where @var{skip}
and @var{count} are integer numbers, then the @samp{nprefix} strategy
will return at most @var{count} headwords that begin with
@var{string}, omitting first @var{skip} unique matches.

This strategy is implemented in the @file{nprefix} loadable module.
@xref{nprefix}.

@item suffix
@cindex suffix, a strategy
Match word suffixes.  This is a built-in strategy.

@item soundex
@cindex soundex, a strategy
Match words using SOUNDEX algorithm@footnote{See
@uref{http://en.wikipedia.org/wiki/Soundex}}.  This strategy matches  
headwords that sound approximately the same as the search term.
Note, that it is suitable only for English words.

This is a built-in strategy.

@item lev
@cindex lev, a strategy
Match headwords within given Levenshtein distance (1 by default).
This strategy accounts for the most usual spelling errors.

@cindex distance, Levenshtein
@cindex Levenshtein distance
The Levenshtein distance between two strings is the minimum number of
@dfn{edits} needed to transform one string into the other.  The
edits are: insertion, deletion, or substitution of a single character.
Thus, Levenshtein distance 1 means that only one such operation
suffices to convert one string to another.  This is the default for
that strategy.

This built-in strategy is used as a default one (@pxref{default
strategy}), unless the @code{default-strategy} configuration statement
mandates otherwise.

The dictionary server may optionally allow users to alter the
Levenshtein distance using the extension command @code{XLEV}.  This
command is enabled by setting the @samp{xlev} capability.
@xref{Capabilities, xlev}, for a detailed description.

@item nlev
@cindex nlev, a strategy
Match normalized headwords within given Levenshtein distance.  This
strategy is similar to @samp{lev}, except that it treats any runlength
of whitespace characters appearing in a headword as a single space
(ASCII 32) character.

@item dlev
@cindex dlev, a strategy
Match headwords within given Damerau-Levenshtein distance (1 by
default).

The Damerau-Levenshtein distance extends the Levenshtein distance by
an additional edit operation: transposition of two adjacent
characters.

This strategy is similar to @samp{lev}, but covers a much wider range of
spelling and typographical errors.

The distance threshold optionally be configured using the @code{XLEV}
command (@pxref{Capabilities, xlev}).

@item ndlev
@cindex ndlev, a strategy
This is the same as @samp{dlev}, except that it treats any runlength
of whitespace characters appearing in a headword as a single space
(ASCII 32) character.

@item re
@cindex re, a strategy
Match using POSIX 1003.2 regular expressions.  This strategy treats
the search term as a regular expression (@pxref{Extended
regexps, Extended regular expressions, Extended regular expressions,
sed, GNU sed}).

@item regexp
@cindex regexp, a strategy
Match using basic regular expressions.

@item pcre
@cindex pcre, a strategy
Match using Perl-compatible regular expressions.  This strategy is
implemented in the loadable module @file{pcre}.  @xref{pcre}.

@item all
@cindex all, a strategy
Match everything.  This experimental strategy ignores its argument and
matches all headwords.  It is implemented in the @file{stratall}
module, which you must load if you wish to make that strategy
available.  @xref{stratall}.

@item substr
@cindex substr, a strategy
Match a substring anywhere in the headword.  This strategy is
implemented as a loadable module.  @xref{substr}.

@item word
@cindex word, a strategy
Match a word anywhere in the headword.  This is one of the strategies
provided by the @file{word} loadable module.  @xref{word}.

@item first
@cindex first, a strategy
Match the first word within headwords.  This strategy is
implemented in @file{word} loadable module.  @xref{word}.

@item last
@cindex last, a strategy
Match the last word within headwords.  This strategy is
implemented in @file{word} loadable module.  @xref{word}.

@end table

  

Return to:

Send suggestions and report system problems to the System administrator.