|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.swabunga.spell.event.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)
|
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 current number of words that have been processed |
int |
getCurrentWordEnd()
Returns the current end word position in the text |
int |
getCurrentWordPosition()
Returns the current character position in the text |
boolean |
hasMoreWords()
Returns true if there are more words that can be processed in the string |
boolean |
isNewSentence()
Returns true if the current word is at the start of a sentence |
java.lang.String |
nextWord()
Returns the next word in the text |
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)
Method Detail |
public boolean hasMoreWords()
hasMoreWords
in interface WordTokenizer
com.swabunga.spell.event.WordTokenizer
public int getCurrentWordPosition()
getCurrentWordPosition
in interface WordTokenizer
com.swabunga.spell.event.WordTokenizer
WordNotFoundException
- current word has not yet been set.public int getCurrentWordEnd()
getCurrentWordEnd
in interface WordTokenizer
com.swabunga.spell.event.WordTokenizer
WordNotFoundException
- current word has not yet been set.public java.lang.String nextWord()
nextWord
in interface WordTokenizer
com.swabunga.spell.event.WordTokenizer
WordNotFoundException
- search string contains no more words.public int getCurrentWordCount()
getCurrentWordCount
in interface WordTokenizer
com.swabunga.spell.event.WordTokenizer
public void replaceWord(java.lang.String newWord)
replaceWord
in interface WordTokenizer
com.swabunga.spell.event.WordTokenizer
newWord
- the string which should replace the current word.WordNotFoundException
- current word has not yet been set.public java.lang.String getContext()
getContext
in interface WordTokenizer
com.swabunga.spell.event.WordTokenizer
public boolean isNewSentence()
isNewSentence
in interface WordTokenizer
com.swabunga.spell.event.WordTokenizer
WordNotFoundException
- current word has not yet been set.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |