C# Класс LevenshteinAutomaton.SpellChecker

Spell Checker uses the Levenshtein automaton and FB-Trie algorithm to find possible corrections for the given garbled word
Показать файл Открыть проект

Открытые методы

Метод Описание
AddWord ( string word ) : void

Append new word to the dictionary

GetCorrections1T ( string typo ) : IList

Gets the corrections for edit distance 1 with transpositions.

GetCorrections2T ( string typo ) : IList

Gets the corrections for edit distance 2 with transpositions.

SpellChecker ( ) : System

Initializes a new instance for empty lexicon

SpellChecker ( IEnumerable words ) : System

Initializes a new instance for the given lexicon

Приватные методы

Метод Описание
GetCorrectionNodes ( string typo, TrieNode start, int editDistance, bool includeOnlyWords = true ) : IList

Basic Schulz and Mihov algoritm

GetCorrectionStrings ( string typo, TrieNode start, int editDistance ) : IEnumerable

Find all words in dictionary such that Levenshtein distance to typo less or equal to editDistance

PrepareSubstrings ( string typo, string &left, string &right, string &rleft, string &rright ) : int

Splits the typo into two substrings of similar length

Описание методов

AddWord() публичный Метод

Append new word to the dictionary
public AddWord ( string word ) : void
word string Word.
Результат void

GetCorrections1T() публичный Метод

Gets the corrections for edit distance 1 with transpositions.
public GetCorrections1T ( string typo ) : IList
typo string Garbled word.
Результат IList

GetCorrections2T() публичный Метод

Gets the corrections for edit distance 2 with transpositions.
public GetCorrections2T ( string typo ) : IList
typo string Garbled word.
Результат IList

SpellChecker() публичный Метод

Initializes a new instance for empty lexicon
public SpellChecker ( ) : System
Результат System

SpellChecker() публичный Метод

Initializes a new instance for the given lexicon
public SpellChecker ( IEnumerable words ) : System
words IEnumerable
Результат System