|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface SpellDictionary
An interface for all dictionary implementations. It defines the most basic operations on a dictionary: adding words, checking if a word is correct, and getting a list of suggestions for misspelled words.
Method Summary | |
---|---|
void |
addWord(java.lang.String word)
Add a word permanently to the dictionary. |
java.util.List |
getSuggestions(java.lang.String sourceWord,
int scoreThreshold)
Returns a list of Word objects that are the suggestions to any word. |
java.util.List |
getSuggestions(java.lang.String sourceWord,
int scoreThreshold,
int[][] matrix)
Returns a list of Word objects that are the suggestions to any word. |
boolean |
isCorrect(java.lang.String word)
Evaluates if the word is correctly spelled against the dictionary. |
Method Detail |
---|
void addWord(java.lang.String word)
word
- The word to add to the dictionaryboolean isCorrect(java.lang.String word)
word
- The word to verify if it's spelling is OK.
java.util.List getSuggestions(java.lang.String sourceWord, int scoreThreshold)
This method is only needed to provide backward compatibility.
sourceWord
- the string that we want to get a list of spelling suggestions forscoreThreshold
- Any words that have score less than this number are returned.
getSuggestions(String, int, int[][])
,
Word
java.util.List getSuggestions(java.lang.String sourceWord, int scoreThreshold, int[][] matrix)
sourceWord
- the string that we want to get a list of spelling suggestions forscoreThreshold
- Any words that have score less than this number are returned.Two
- dimensional int array used to calculate edit distance. Allocating
this memory outside of the function will greatly improve efficiency.
Word
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |