@Deprecated public class CachingTokenizer extends Object implements TokenizingTokenizer
This class is thread-safe provided its components are and the
setTokenizer(Tokenizer) is not called in a
concurrent context.
StringMetricBuilder| Constructor and Description |
|---|
CachingTokenizer(int initialCapacity,
int maximumSize)
Deprecated.
Creates a caching tokenizer with
initialCapacity and
maximumSize. |
CachingTokenizer(int initialCapacity,
int maximumSize,
Tokenizer tokenizer)
Deprecated.
Creates a caching tokenizer with
initialCapacity and
maximumSize. |
| Modifier and Type | Method and Description |
|---|---|
Tokenizer |
getTokenizer()
Deprecated.
Gets the tokenizer.
|
void |
setTokenizer(Tokenizer tokenizer)
Deprecated.
Sets the tokenizer.
|
List<String> |
tokenizeToList(String input)
Deprecated.
Return tokenized version of a string as a list of tokens.
|
Set<String> |
tokenizeToSet(String input)
Deprecated.
Return tokenized version of a string as a set of tokens.
|
String |
toString()
Deprecated.
|
public CachingTokenizer(int initialCapacity,
int maximumSize)
initialCapacity and
maximumSize. Least used cache entries are evicted once the cache
reaches its maximum size.
Note: A delegated tokenizer must be set through through
setTokenizer(Tokenizer)
initialCapacity - initial size of the cachemaximumSize - maximum size of the cachepublic CachingTokenizer(int initialCapacity,
int maximumSize,
Tokenizer tokenizer)
initialCapacity and
maximumSize. Least used cache entries are evicted once the cache
reaches its maximum size.
Uses the delegated tokenizer to perform the tokenization.
initialCapacity - initial size of the cachemaximumSize - maximum size of the cachetokenizer - the delegate tokenizerpublic Tokenizer getTokenizer()
TokenizinggetTokenizer in interface Tokenizingpublic void setTokenizer(Tokenizer tokenizer)
TokenizingsetTokenizer in interface Tokenizingtokenizer - a tokenizer to setpublic List<String> tokenizeToList(String input)
TokenizertokenizeToList in interface Tokenizerinput - input string to tokenizepublic Set<String> tokenizeToSet(String input)
TokenizertokenizeToSet in interface Tokenizerinput - input string to tokenizeCopyright © 2014–2018. All rights reserved.