com.swabunga.spell.event
public class DocumentWordTokenizer extends Object implements WordTokenizer
Constructor Summary | |
---|---|
DocumentWordTokenizer(Document document)
Creates a new DocumentWordTokenizer to work on a document |
Method Summary | |
---|---|
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 |
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(String newWord) Replaces the current word token |
Parameters: document The document to spell check
Returns: The text, including changes.
Returns: the number of words found so far.
Returns: index of the end of the current word in the text.
Returns: the number of words found so far.
Returns: true if more words can be found in the text.
Returns: true if the current word is at the start of a sentence
Returns: the next word in the iteration.
Parameters: pos position in the word we want to set as current.
Parameters: newWord The new word to replace the misspelt one