On Thu, Nov 3, 2011 at 4:06 PM, Nagendra Mishr <nmi...@gmail.com> wrote:
> The scenarios that could use dictionary matching: > > 1. Document being processed to see if it contains one of 10,000 terms. > > 2. Query completion as you type > > 3. Basically the inverse of finding a document.. Instead the document > is the query term and the dictionary of terms is being matched in > parallel > > Try the Aho-Corasick algorithm - http://en.wikipedia.org/wiki/Aho%E2%80%93Corasick_string_matching_algorithm "It is a kind of dictionary-matching algorithm that locates elements of a finite set of strings (the "dictionary") within an input text. It matches all patterns simultaneously. The complexity<http://en.wikipedia.org/wiki/Computational_complexity_theory>of the algorithm is linear in the length of the patterns plus the length of the searched text plus the number of output matches." HTH, Vijay