Package org.apache.lucene.analysis.util
Class TokenizerFactory
- java.lang.Object
-
- org.apache.lucene.analysis.util.AbstractAnalysisFactory
-
- org.apache.lucene.analysis.util.TokenizerFactory
-
- Direct Known Subclasses:
ArabicLetterTokenizerFactory
,ChineseTokenizerFactory
,CJKTokenizerFactory
,ClassicTokenizerFactory
,EdgeNGramTokenizerFactory
,KeywordTokenizerFactory
,LetterTokenizerFactory
,LowerCaseTokenizerFactory
,NGramTokenizerFactory
,PathHierarchyTokenizerFactory
,PatternTokenizerFactory
,RussianLetterTokenizerFactory
,StandardTokenizerFactory
,UAX29URLEmailTokenizerFactory
,WhitespaceTokenizerFactory
,WikipediaTokenizerFactory
public abstract class TokenizerFactory extends AbstractAnalysisFactory
Abstract parent class for analysis factories that createTokenizer
instances.
-
-
Field Summary
-
Fields inherited from class org.apache.lucene.analysis.util.AbstractAnalysisFactory
LUCENE_MATCH_VERSION_PARAM
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static java.util.Set<java.lang.String>
availableTokenizers()
returns a list of all available tokenizer names from context classpathTokenizer
create(java.io.Reader input)
Creates a TokenStream of the specified input using the default attribute factory.abstract Tokenizer
create(AttributeSource.AttributeFactory factory, java.io.Reader input)
Creates a TokenStream of the specified input using the given AttributeFactorystatic TokenizerFactory
forName(java.lang.String name, java.util.Map<java.lang.String,java.lang.String> args)
looks up a tokenizer by name from context classpathstatic java.lang.Class<? extends TokenizerFactory>
lookupClass(java.lang.String name)
looks up a tokenizer class by name from context classpathstatic void
reloadTokenizers(java.lang.ClassLoader classloader)
Reloads the factory list from the givenClassLoader
.-
Methods inherited from class org.apache.lucene.analysis.util.AbstractAnalysisFactory
get, get, get, get, get, getChar, getClassArg, getLuceneMatchVersion, getOriginalArgs, getSet, isExplicitLuceneMatchVersion, require, require, require, requireChar, setExplicitLuceneMatchVersion
-
-
-
-
Method Detail
-
forName
public static TokenizerFactory forName(java.lang.String name, java.util.Map<java.lang.String,java.lang.String> args)
looks up a tokenizer by name from context classpath
-
lookupClass
public static java.lang.Class<? extends TokenizerFactory> lookupClass(java.lang.String name)
looks up a tokenizer class by name from context classpath
-
availableTokenizers
public static java.util.Set<java.lang.String> availableTokenizers()
returns a list of all available tokenizer names from context classpath
-
reloadTokenizers
public static void reloadTokenizers(java.lang.ClassLoader classloader)
Reloads the factory list from the givenClassLoader
. 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!
-
create
public final Tokenizer create(java.io.Reader input)
Creates a TokenStream of the specified input using the default attribute factory.
-
create
public abstract Tokenizer create(AttributeSource.AttributeFactory factory, java.io.Reader input)
Creates a TokenStream of the specified input using the given AttributeFactory
-
-