public final class WhitespaceTokenizer extends CharTokenizer
Character.isWhitespace(int). Note: That definition explicitly excludes the non-breaking space.
Adjacent sequences of non-Whitespace characters form tokens.UnicodeWhitespaceTokenizerAttributeSource.StateDEFAULT_MAX_WORD_LENDEFAULT_TOKEN_ATTRIBUTE_FACTORY| Constructor and Description |
|---|
WhitespaceTokenizer()
Construct a new WhitespaceTokenizer.
|
WhitespaceTokenizer(AttributeFactory factory)
Construct a new WhitespaceTokenizer using a given
AttributeFactory. |
WhitespaceTokenizer(AttributeFactory factory,
int maxTokenLen)
Construct a new WhitespaceTokenizer using a given
AttributeFactory. |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
isTokenChar(int c)
Collects only characters which do not satisfy
Character.isWhitespace(int). |
end, fromSeparatorCharPredicate, fromSeparatorCharPredicate, fromTokenCharPredicate, fromTokenCharPredicate, incrementToken, resetclose, correctOffset, setReaderaddAttribute, addAttributeImpl, captureState, clearAttributes, cloneAttributes, copyTo, endAttributes, equals, getAttribute, getAttributeClassesIterator, getAttributeFactory, getAttributeImplsIterator, hasAttribute, hasAttributes, hashCode, reflectAsString, reflectWith, removeAllAttributes, restoreState, toStringpublic WhitespaceTokenizer()
public WhitespaceTokenizer(AttributeFactory factory)
AttributeFactory.factory - the attribute factory to use for this Tokenizerpublic WhitespaceTokenizer(AttributeFactory factory, int maxTokenLen)
AttributeFactory.factory - the attribute factory to use for this TokenizermaxTokenLen - maximum token length the tokenizer will emit.
Must be greater than 0 and less than MAX_TOKEN_LENGTH_LIMIT (1024*1024)IllegalArgumentException - if maxTokenLen is invalid.protected boolean isTokenChar(int c)
Character.isWhitespace(int).isTokenChar in class CharTokenizerCopyright © 2000-2019 Apache Software Foundation. All Rights Reserved.