public abstract class TokenizerFactory extends AbstractAnalysisFactory
Tokenizer
instances.LUCENE_MATCH_VERSION_PARAM, luceneMatchVersion
Modifier | Constructor and Description |
---|---|
protected |
TokenizerFactory(Map<String,String> args)
Initialize this factory via a set of key-value pairs.
|
Modifier and Type | Method and Description |
---|---|
static Set<String> |
availableTokenizers()
returns a list of all available tokenizer names from context classpath
|
abstract Tokenizer |
create(AttributeSource.AttributeFactory factory,
Reader input)
Creates a TokenStream of the specified input using the given AttributeFactory
|
Tokenizer |
create(Reader input)
Creates a TokenStream of the specified input using the default attribute factory.
|
static TokenizerFactory |
forName(String name,
Map<String,String> args)
looks up a tokenizer by name from context classpath
|
static Class<? extends TokenizerFactory> |
lookupClass(String name)
looks up a tokenizer class by name from context classpath
|
static void |
reloadTokenizers(ClassLoader classloader)
Reloads the factory list from the given
ClassLoader . |
assureMatchVersion, get, get, get, get, get, getBoolean, getChar, getClassArg, getFloat, getInt, getLines, getLuceneMatchVersion, getOriginalArgs, getPattern, getSet, getSnowballWordSet, getWordSet, isExplicitLuceneMatchVersion, require, require, require, requireBoolean, requireChar, requireFloat, requireInt, setExplicitLuceneMatchVersion, splitFileNames
public static TokenizerFactory forName(String name, Map<String,String> args)
public static Class<? extends TokenizerFactory> lookupClass(String name)
public static Set<String> availableTokenizers()
public static void reloadTokenizers(ClassLoader classloader)
ClassLoader
.
Changes to the factories are visible after the method ends, all
iterators (availableTokenizers()
,...) stay consistent.
NOTE: Only new factories are added, existing ones are never removed or replaced.
This method is expensive and should only be called for discovery of new factories on the given classpath/classloader!
public final Tokenizer create(Reader input)
public abstract Tokenizer create(AttributeSource.AttributeFactory factory, Reader input)
Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.