public final class NaturalWordLocator extends java.lang.Object implements WordLocator
NaturalWordLocator implementation that locates
word boundaries on the JDK's BreakIterator for
natural language boundaries. WordLocator| Constructor and Description |
|---|
NaturalWordLocator(LanguageSupport support)
Constructs a new NaturalWordLocator.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getNextWordEnd(int offset)
Fetches the next offset where a word ends.
|
int |
getNextWordStart(int offset)
Fetches the next offset where a word starts from.
|
int |
getPreviousWordEnd(int offset)
Fetches the previous offset where a word ends.
|
int |
getPreviousWordStart(int offset)
Fetches the previous offset where a word starts from.
|
int |
getWordEnd(int offset)
Fetches the end of the word for the given offset location.
|
int |
getWordStart(int offset)
Fetches the start of the word for the given offset location.
|
public NaturalWordLocator(LanguageSupport support)
support - the language support and document this locator is used forpublic int getWordStart(int offset)
getWordStart in interface WordLocatoroffset - the specified document offsetpublic int getWordEnd(int offset)
getWordEnd in interface WordLocatoroffset - the specified document offsetpublic int getNextWordStart(int offset)
getNextWordStart in interface WordLocatoroffset - the specified document offsetpublic int getNextWordEnd(int offset)
getNextWordEnd in interface WordLocatoroffset - the specified document offsetpublic int getPreviousWordStart(int offset)
getPreviousWordStart in interface WordLocatoroffset - the specified document offsetpublic int getPreviousWordEnd(int offset)
getPreviousWordEnd in interface WordLocatoroffset - the specified document offset