Dico |
|
GNU Dictionary Server |
Sergey Poznyakoff |
Appendix A Available Strategies
This appendix summarizes search strategies available for use in Dico 2.10.
- exact
-
Match words exactly. This is a built-in strategy.
- prefix
-
Match word prefixes. This is a built-in strategy.
- nprefix
-
This strategy is similar to ‘prefix’, except that it allows the user to limit the number of returned matches. If the search term has the structure ‘skip#count#string’, where skip and count are integer numbers, then the ‘nprefix’ strategy will return at most count headwords that begin with string, omitting first skip unique matches.
This strategy is implemented in the nprefix loadable module. See nprefix.
- suffix
-
Match word suffixes. This is a built-in strategy.
- soundex
-
Match words using SOUNDEX algorithm5. 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.
- lev
-
Match headwords within given Levenshtein distance (1 by default). This strategy accounts for the most usual spelling errors.
The Levenshtein distance between two strings is the minimum number of 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 (see default strategy), unless the
default-strategy
configuration statement mandates otherwise.The dictionary server may optionally allow users to alter the Levenshtein distance using the extension command
XLEV
. This command is enabled by setting the ‘xlev’ capability. See xlev, for a detailed description. - nlev
-
Match normalized headwords within given Levenshtein distance. This strategy is similar to ‘lev’, except that it treats any runlength of whitespace characters appearing in a headword as a single space (ASCII 32) character.
- dlev
-
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 ‘lev’, but covers a much wider range of spelling and typographical errors.
The distance threshold optionally be configured using the
XLEV
command (see xlev). - ndlev
-
This is the same as ‘dlev’, except that it treats any runlength of whitespace characters appearing in a headword as a single space (ASCII 32) character.
- re
-
Match using POSIX 1003.2 regular expressions. This strategy treats the search term as a regular expression (see Extended regular expressions in GNU sed).
- regexp
-
Match using basic regular expressions.
- pcre
-
Match using Perl-compatible regular expressions. This strategy is implemented in the loadable module pcre. See pcre.
- all
-
Match everything. This experimental strategy ignores its argument and matches all headwords. It is implemented in the stratall module, which you must load if you wish to make that strategy available. See stratall.
- substr
-
Match a substring anywhere in the headword. This strategy is implemented as a loadable module. See substr.
- word
-
Match a word anywhere in the headword. This is one of the strategies provided by the word loadable module. See word.
- first
-
Match the first word within headwords. This strategy is implemented in word loadable module. See word.
- last
-
Match the last word within headwords. This strategy is implemented in word loadable module. See word.
This document was generated on September 4, 2020 using makeinfo.
Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved.