public class StringWordTokenizer extends AbstractWordTokenizer
It also allows for the string to be altered by calls to replaceWord(). The result after the spell checking is completed is available to the call to getContext.
currentWord, finder, sentenceIterator, wordCount
Constructor and Description |
---|
StringWordTokenizer(java.lang.String s)
Creates a new StringWordTokenizer object.
|
StringWordTokenizer(java.lang.String s,
WordFinder finder)
Creates a new StringWordTokenizer object.
|
StringWordTokenizer(WordFinder wf)
Creates a new StringWordTokenizer object.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getFinalText()
Deprecated.
use getContext() instead as per the WordTokenizer
interface specification.
|
void |
replaceWord(java.lang.String s)
Replace the current word in the iteration with the String s.
|
getContext, getCurrentWordCount, getCurrentWordEnd, getCurrentWordPosition, hasMoreWords, isNewSentence, nextWord
public StringWordTokenizer(java.lang.String s)
s
- the string to tokenize.public StringWordTokenizer(WordFinder wf)
wf
- the custom WordFinder to use in tokenizing. Note
that the string to tokenize will be encapsulated within the WordFinder.public StringWordTokenizer(java.lang.String s, WordFinder finder)
s
- the string to work onfinder
- the custom WordFinder to use in tokenizing. Note
that the string to tokenize will be encapsulated within the WordFinder.public java.lang.String getFinalText()
public void replaceWord(java.lang.String s)
replaceWord
in interface WordTokenizer
replaceWord
in class AbstractWordTokenizer
s
- the String to replace the current word.WordNotFoundException
- current word not yet set.