|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.swabunga.spell.event.DocumentWordTokenizer
public class DocumentWordTokenizer
This class tokenizes a swing document model. It also allows for the document model to be changed when corrections occur.
Constructor Summary | |
---|---|
DocumentWordTokenizer(javax.swing.text.Document document)
Creates a new DocumentWordTokenizer to work on a document |
Method Summary | |
---|---|
java.lang.String |
getContext()
Returns the current text that is being tokenized (includes any changes that have been made) |
int |
getCurrentWordCount()
Returns the number of word tokens that have been processed thus far |
int |
getCurrentWordEnd()
Returns an index representing the end location of the current word in the text. |
int |
getCurrentWordPosition()
Returns the number of word tokens that have been processed thus far |
boolean |
hasMoreWords()
Indicates if there are more words left |
boolean |
isNewSentence()
Indicates if the current word is at the start of a sentence |
java.lang.String |
nextWord()
This returns the next word in the iteration. |
void |
posStartFullWordFrom(int pos)
Sets the current word position at the start of the word containing the char at position pos. |
void |
replaceWord(java.lang.String newWord)
Replaces the current word token |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DocumentWordTokenizer(javax.swing.text.Document document)
document
- The document to spell checkMethod Detail |
---|
public boolean hasMoreWords()
hasMoreWords
in interface WordTokenizer
public void posStartFullWordFrom(int pos)
pos
- position in the word we want to set as current.public int getCurrentWordPosition()
getCurrentWordPosition
in interface WordTokenizer
public int getCurrentWordEnd()
getCurrentWordEnd
in interface WordTokenizer
public java.lang.String nextWord()
nextWord
in interface WordTokenizer
public int getCurrentWordCount()
getCurrentWordCount
in interface WordTokenizer
public void replaceWord(java.lang.String newWord)
replaceWord
in interface WordTokenizer
newWord
- The new word to replace the misspelt onepublic java.lang.String getContext()
getContext
in interface WordTokenizer
public boolean isNewSentence()
isNewSentence
in interface WordTokenizer
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |