Package opennlp.tools.tokenize
Class WhitespaceTokenizer
java.lang.Object
opennlp.tools.tokenize.WhitespaceTokenizer
- All Implemented Interfaces:
Tokenizer
-
Field Summary
Modifier and TypeFieldDescriptionstatic final WhitespaceTokenizer
Use this static reference to retrieve an instance of theWhitespaceTokenizer
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
setKeepNewLines
(boolean keepNewLines) Switches whether to keep new lines or not.String[]
Splits a string into its atomic parts.Span[]
Finds the boundaries of atomic parts in a string.
-
Field Details
-
INSTANCE
Use this static reference to retrieve an instance of theWhitespaceTokenizer
.
-
-
Method Details
-
tokenizePos
Description copied from interface:Tokenizer
Finds the boundaries of atomic parts in a string.- Parameters:
d
- The string to be tokenized.- Returns:
- The
spans (offsets into
for each token as the individuals array elements.s
)
-
tokenize
Description copied from interface:Tokenizer
Splits a string into its atomic parts. -
setKeepNewLines
public void setKeepNewLines(boolean keepNewLines) Switches whether to keep new lines or not.- Parameters:
keepNewLines
-True
if new lines are kept,false
otherwise.
-