public class Word extends java.lang.Object implements java.util.Comparator<Word>
| Constructor and Description |
|---|
Word()
Constructs a new Word.
|
Word(java.lang.String text,
int score)
Constructs a new Word.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compare(Word word1,
Word word2)
Compares two words, mostly for the purpose of sorting words.
|
boolean |
equals(java.lang.Object o)
Indicates if this text is equal to another one.
|
int |
getCost()
A cost measures how close a match this text was to the original text.
|
java.lang.String |
getText()
gets suggested spelling
|
int |
hashCode() |
void |
setText(java.lang.String text)
Sets suggested spelling.
|
public Word(java.lang.String text,
int score)
text - the text of a suggested spellingscore - the cost of transformation between the tested word and textpublic Word()
public int compare(Word word1, Word word2)
compare in interface java.util.Comparator<Word>word1 - the first textword2 - the second textpublic boolean equals(java.lang.Object o)
equals in interface java.util.Comparator<Word>equals in class java.lang.Objecto - The other text to comparepublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String getText()
public void setText(java.lang.String text)
text - the text of the suggested spellingpublic int getCost()
EditDistance