Topic Path: Symbol Reference > Classes > TIdDICTServer Class > TIdDICTServer Events > OnCommandMatch Event
TIdDICTServer.OnCommandMatch Event

Specifies the DICT MATCH command event handler.

property OnCommandMatch: TIdDICTMatchEvent;

OnCommandMatch specifies the TIdDICTMatchEvent event handler used to respond to the DICT MATCH command, as described in RFC 2229. 

The DICT MATCH command is used 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.

Applications should assign a procedure to the event handler in order to respond to the DICT command, or the server will return the default message: 


500 command not recognized
Copyright 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Post feedback to the Indy Docs Newsgroup.