Operator Reference

suggest_lexiconT_suggest_lexiconSuggestLexiconSuggestLexiconsuggest_lexicon (Operator)

suggest_lexiconT_suggest_lexiconSuggestLexiconSuggestLexiconsuggest_lexicon — Find a similar word in a lexicon.

Signature

suggest_lexicon( : : LexiconHandle, Word : Suggestion, NumCorrections)

Herror T_suggest_lexicon(const Htuple LexiconHandle, const Htuple Word, Htuple* Suggestion, Htuple* NumCorrections)

void SuggestLexicon(const HTuple& LexiconHandle, const HTuple& Word, HTuple* Suggestion, HTuple* NumCorrections)

HString HLexicon::SuggestLexicon(const HString& Word, Hlong* NumCorrections) const

HString HLexicon::SuggestLexicon(const char* Word, Hlong* NumCorrections) const

HString HLexicon::SuggestLexicon(const wchar_t* Word, Hlong* NumCorrections) const   ( Windows only)

static void HOperatorSet.SuggestLexicon(HTuple lexiconHandle, HTuple word, out HTuple suggestion, out HTuple numCorrections)

string HLexicon.SuggestLexicon(string word, out int numCorrections)

def suggest_lexicon(lexicon_handle: HHandle, word: str) -> Tuple[str, int]

Description

suggest_lexiconsuggest_lexiconSuggestLexiconSuggestLexiconsuggest_lexicon compares WordWordWordwordword to all words in the lexicon and calculates the minimum number of edit operations NumCorrectionsNumCorrectionsNumCorrectionsnumCorrectionsnum_corrections required to transform WordWordWordwordword into a word from the lexicon. Valid edit operations are the insertion, deletion and replacement of characters. The most similar word found in the lexicon is returned in SuggestionSuggestionSuggestionsuggestionsuggestion. If there are multiple words with the same minimum number of corrections, only the first of those words is returned.

Execution Information

  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).
  • Multithreading scope: global (may be called from any thread).
  • Processed without parallelization.

Parameters

LexiconHandleLexiconHandleLexiconHandlelexiconHandlelexicon_handle (input_control)  lexicon HLexicon, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Handle of the lexicon.

WordWordWordwordword (input_control)  string HTuplestrHTupleHtuple (string) (string) (HString) (char*)

Word to be looked up.

Default: 'word' "word" "word" "word" "word"

SuggestionSuggestionSuggestionsuggestionsuggestion (output_control)  string HTuplestrHTupleHtuple (string) (string) (HString) (char*)

Most similar word found in the lexicon.

NumCorrectionsNumCorrectionsNumCorrectionsnumCorrectionsnum_corrections (output_control)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Difference between the words in edit operations.

Alternatives

lookup_lexiconlookup_lexiconLookupLexiconLookupLexiconlookup_lexicon, tuple_str_distancetuple_str_distanceTupleStrDistanceTupleStrDistancetuple_str_distance

See also

create_lexiconcreate_lexiconCreateLexiconCreateLexiconcreate_lexicon

References

Vladimir I. Levenshtein, Binary codes capable of correcting deletions, insertions, and reversals, Doklady Akademii Nauk SSSR, 163(4):845-848, 1965 (Russian). English translation in Soviet Physics Doklady, 10(8):707-710, 1966.

Module

OCR/OCV