C# 클래스 LevenshteinAutomaton.SpellChecker

Spell Checker uses the Levenshtein automaton and FB-Trie algorithm to find possible corrections for the given garbled word
파일 보기 프로젝트 열기: ibendrup/LevenshteinAutomaton

공개 메소드들

메소드 설명
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