public abstract class ModifiedTokenizerFactory extends Object implements TokenizerFactory
ModifiedTokenizerFactory is an abstract tokenizer factory
that modifies a tokenizer returned by a base tokenizer factory.
The abstract method modify(Tokenizer) implements
the modification.
Serializable. There are no
serialization methods defined, so the default serialization is
used. There is a single reference to the base tokenizer factory,
so a subclass will be serializable if all of its member objects
are serializable and the base tokenizer is serializable.
It is good practice for each subclass to take completecontrol
over serialization using a serialization proxy implemented
on top of the AbstractExternalizable base
class.
modify()
method is thread safe.| Constructor and Description |
|---|
ModifiedTokenizerFactory(TokenizerFactory baseFactory)
Construct a modified tokenizer factory with the
specified base factory.
|
| Modifier and Type | Method and Description |
|---|---|
TokenizerFactory |
baseTokenizerFactory()
Return the base tokenizer factory.
|
protected abstract Tokenizer |
modify(Tokenizer tokenizer)
Return a modified form of the specified tokenizer.
|
Tokenizer |
tokenizer(char[] cs,
int start,
int length)
Return the tokenizer for the specified character array slice,
which is generated by the base tokenizer and modified with
the modify method.
|
String |
toString() |
public ModifiedTokenizerFactory(TokenizerFactory baseFactory)
baseFactory - Underlying tokenizer factory whose
tokenizers are modified.public TokenizerFactory baseTokenizerFactory()
public Tokenizer tokenizer(char[] cs, int start, int length)
tokenizer in interface TokenizerFactorycs - Characters to tokenize.start - Index of first character to tokenize.length - Number of characters to tokenize.protected abstract Tokenizer modify(Tokenizer tokenizer)
tokenizer(char[],int,int).tokenizer - Tokenizer to modify.Copyright © 2019 Alias-i, Inc.. All rights reserved.