| java.lang.Object org.incava.text.SpellChecker
All known Subclasses: org.incava.text.NoCaseSpellChecker,
SpellChecker | public class SpellChecker (Code) | | Calculates the edit distance between two strings.
|
Method Summary | |
public boolean | addDictionary(String dictionary) Adds the given dictionary. | public void | addWord(String word) | protected int | compare(String str1, int len1, String str2, int len2) Compares the two characters. | public int | editDistance(String str1, String str2) Computes the Levenstein edit distance between the two words, with a
maximum of 3, at which point the distance is no longer computed. | public int | editDistance(String str1, String str2, int maximum) Computes the Levenstein edit distance between the two words. | public String | getKey(String word) | public boolean | hasWord(String word) | public boolean | isCorrect(String word, int maxEditDistance, Map nearMatches) | public boolean | isCorrect(String word, Map nearMatches) | protected static int | min3(int x, int y, int z) | public boolean | nearMatch(String str1, String str2) |
ARR_SIZE | final protected static int ARR_SIZE(Code) | | |
COMP_LEN | final protected static int COMP_LEN(Code) | | |
DEFAULT_MAX_DISTANCE | final public static int DEFAULT_MAX_DISTANCE(Code) | | |
addDictionary | public boolean addDictionary(String dictionary)(Code) | | Adds the given dictionary. Returns whether it could be read and had content.
|
compare | protected int compare(String str1, int len1, String str2, int len2)(Code) | | Compares the two characters. English words should probably be case
insensitive; code should not.
|
editDistance | public int editDistance(String str1, String str2)(Code) | | Computes the Levenstein edit distance between the two words, with a
maximum of 3, at which point the distance is no longer computed.
|
editDistance | public int editDistance(String str1, String str2, int maximum)(Code) | | Computes the Levenstein edit distance between the two words.
|
isCorrect | public boolean isCorrect(String word, int maxEditDistance, Map nearMatches)(Code) | | Parameters: nearMatches - a map from edit distances to matches. |
min3 | protected static int min3(int x, int y, int z)(Code) | | |
|
|