Indy 9 | Content | Index | Reference

TIdDICTMatchEvent
Unit: IdDICTServer
Specifies the event type for the DICT MATCH command.

    TIdDICTMatchEvent = procedure ( Thread: TIdPeerThread; Database, Strategy,WordToFind : String ) of object;

Unit
IdDICTServer
Parameters
Database
Name or wildcard identifying the database(s) to be searched.
Strategy
Desired Search algorithm.
Thread
Execution Thread performing the command.
WordToFind
Word to locate in the dictionary database(s).
Description
TIdDICTMatchEvent specifies the event type for the DICT MATCH command, and is used by the TIdDICTServer OnCommandMatch event handler to search the dictionary index and report the words found using a particular strategy.

All DICT servers must implement the MATCH command, and must support the "exact" and "prefix" strategies.

The "exact" strategy performs a case-insensitive comparison. The "prefix" strategy is similar to "exact", except that it only compares the first part of the word. These strategies are easily implemented and are generally the most useful. Other strategies are server dependent.

Other strategies that might be considered are matches based on substring, suffix, regular expressions, soundex [KNUTH73], and Levenshtein [PZ85] algorithms. These last two are especially useful for correcting spelling errors. Other useful strategies perform some sort of "reverse" lookup (i.e., by searching definitions to find the word that the query suggests).

Strategy may also contain the special character ".", which indicates that the server should use the default strategy for that server. This is usually a derivative of the Levenshtein algorithm [PZ85].

Database contains the name of the database to be searched, in a form returned by SHOW DB, or one the following wildcard characters:

- "!" - Search all databases until a match is found.

- "*" - Search for all matches in the current database.

Created with Doc-O-Matic 2 donated to Project JEDI. Commercial license available from the Doc-O-Matic site.