Skip to content

suggest_lexiconSuggestLexiconSuggestLexiconsuggest_lexiconT_suggest_lexicon🔗

Short description🔗

suggest_lexiconSuggestLexiconSuggestLexiconsuggest_lexiconT_suggest_lexicon — Find a similar word in a lexicon.

Signature🔗

suggest_lexicon( lexicon LexiconHandle, string Word, out string Suggestion, out integer NumCorrections )void SuggestLexicon( const HTuple& LexiconHandle, const HTuple& Word, HTuple* Suggestion, HTuple* NumCorrections )static void HOperatorSet.SuggestLexicon( HTuple lexiconHandle, HTuple word, out HTuple suggestion, out HTuple numCorrections )def suggest_lexicon( lexicon_handle: HHandle, word: str ) -> Tuple[str, int]

Herror T_suggest_lexicon( 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)

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

Description🔗

suggest_lexiconSuggestLexicon compares Wordwordword to all words in the lexicon and calculates the minimum number of edit operations NumCorrectionsnumCorrectionsnum_corrections required to transform Wordwordword 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 Suggestionsuggestionsuggestion. If there are multiple words with the same minimum number of corrections, only the first of those words is returned.

Execution information🔗

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🔗

LexiconHandlelexiconHandlelexicon_handle (input_control) lexicon → (handle)HTuple (HHandle)HLexicon, HTuple (IntPtr)HHandleHtuple (handle)

Handle of the lexicon.

Wordwordword (input_control) string → (string)HTuple (HString)HTuple (string)strHtuple (char*)

Word to be looked up.

Default: 'word'"word"

Suggestionsuggestionsuggestion (output_control) string → (string)HTuple (HString)HTuple (string)strHtuple (char*)

Most similar word found in the lexicon.

NumCorrectionsnumCorrectionsnum_corrections (output_control) integer → (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Difference between the words in edit operations.

Combinations with other operators🔗

Combinations

Alternatives

lookup_lexiconLookupLexicon, tuple_str_distanceTupleStrDistance

See also

create_lexiconCreateLexicon

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