|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.swabunga.spell.engine.Word
The Word object holds information for one suggested spelling. It contains both the suggested word string and the distance cost, which represents how different the suggested word is from the misspelling.
This class is now immutable.
Constructor Summary | |
Word()
|
|
Word(java.lang.String word,
int score)
|
Method Summary | |
int |
compare(java.lang.Object o1,
java.lang.Object o2)
Compares two words, mostly for the purpose of sorting words. |
boolean |
equals(java.lang.Object o)
|
int |
getCost()
A cost measures how close a match this word was to the original word |
java.lang.String |
getWord()
gets suggested spelling |
java.lang.String |
toString()
returns the suggested spelling |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Word(java.lang.String word, int score)
public Word()
Method Detail |
public int compare(java.lang.Object o1, java.lang.Object o2)
compare
in interface java.util.Comparator
o1
- the first wordo2
- the second word
public boolean equals(java.lang.Object o)
equals
in interface java.util.Comparator
public java.lang.String getWord()
public int getCost()
EditDistance
public java.lang.String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |