public abstract class AbstractAnalysisFactory extends Object
TokenizerFactory
,
TokenFilterFactory
and CharFilterFactory
.
The typical lifecycle for a factory consumer is:
ResourceLoaderAware.inform(ResourceLoader)
is called to initialize those resources.
Modifier and Type | Field and Description |
---|---|
static String |
LUCENE_MATCH_VERSION_PARAM |
protected Version |
luceneMatchVersion
the luceneVersion arg
|
Modifier | Constructor and Description |
---|---|
protected |
AbstractAnalysisFactory(Map<String,String> args)
Initialize this factory via a set of key-value pairs.
|
Modifier and Type | Method and Description |
---|---|
String |
get(Map<String,String> args,
String name) |
String |
get(Map<String,String> args,
String name,
Collection<String> allowedValues) |
String |
get(Map<String,String> args,
String name,
Collection<String> allowedValues,
String defaultVal) |
String |
get(Map<String,String> args,
String name,
Collection<String> allowedValues,
String defaultVal,
boolean caseSensitive) |
String |
get(Map<String,String> args,
String name,
String defaultVal) |
protected boolean |
getBoolean(Map<String,String> args,
String name,
boolean defaultVal) |
char |
getChar(Map<String,String> args,
String name,
char defaultValue) |
String |
getClassArg() |
protected float |
getFloat(Map<String,String> args,
String name,
float defaultVal) |
protected int |
getInt(Map<String,String> args,
String name,
int defaultVal) |
protected List<String> |
getLines(ResourceLoader loader,
String resource)
Returns the resource's lines (with content treated as UTF-8)
|
Version |
getLuceneMatchVersion() |
Map<String,String> |
getOriginalArgs() |
protected Pattern |
getPattern(Map<String,String> args,
String name)
Compiles a pattern for the value of the specified argument key
name |
Set<String> |
getSet(Map<String,String> args,
String name)
Returns whitespace- and/or comma-separated set of values, or null if none are found
|
protected CharArraySet |
getSnowballWordSet(ResourceLoader loader,
String wordFiles,
boolean ignoreCase)
same as
getWordSet(ResourceLoader, String, boolean) ,
except the input is in snowball format. |
protected CharArraySet |
getWordSet(ResourceLoader loader,
String wordFiles,
boolean ignoreCase)
Returns as
CharArraySet from wordFiles, which
can be a comma-separated list of filenames |
boolean |
isExplicitLuceneMatchVersion() |
String |
require(Map<String,String> args,
String name) |
String |
require(Map<String,String> args,
String name,
Collection<String> allowedValues) |
String |
require(Map<String,String> args,
String name,
Collection<String> allowedValues,
boolean caseSensitive) |
protected boolean |
requireBoolean(Map<String,String> args,
String name) |
char |
requireChar(Map<String,String> args,
String name) |
protected float |
requireFloat(Map<String,String> args,
String name) |
protected int |
requireInt(Map<String,String> args,
String name) |
void |
setExplicitLuceneMatchVersion(boolean isExplicitLuceneMatchVersion) |
protected List<String> |
splitAt(char separator,
String list)
Splits a list separated by zero or more given separator characters.
|
protected List<String> |
splitFileNames(String fileNames)
Splits file names separated by comma character.
|
public static final String LUCENE_MATCH_VERSION_PARAM
protected final Version luceneMatchVersion
public final Version getLuceneMatchVersion()
public String require(Map<String,String> args, String name, Collection<String> allowedValues)
public String require(Map<String,String> args, String name, Collection<String> allowedValues, boolean caseSensitive)
public String get(Map<String,String> args, String name, Collection<String> allowedValues, String defaultVal)
public String get(Map<String,String> args, String name, Collection<String> allowedValues, String defaultVal, boolean caseSensitive)
protected final boolean getBoolean(Map<String,String> args, String name, boolean defaultVal)
public Set<String> getSet(Map<String,String> args, String name)
protected final Pattern getPattern(Map<String,String> args, String name)
name
protected final CharArraySet getWordSet(ResourceLoader loader, String wordFiles, boolean ignoreCase) throws IOException
CharArraySet
from wordFiles, which
can be a comma-separated list of filenamesIOException
protected final List<String> getLines(ResourceLoader loader, String resource) throws IOException
IOException
protected final CharArraySet getSnowballWordSet(ResourceLoader loader, String wordFiles, boolean ignoreCase) throws IOException
getWordSet(ResourceLoader, String, boolean)
,
except the input is in snowball format.IOException
protected final List<String> splitFileNames(String fileNames)
fileNames
- the string containing file namesprotected final List<String> splitAt(char separator, String list)
list
- the string containing the split list itemspublic String getClassArg()
getClass().getName()
.public boolean isExplicitLuceneMatchVersion()
public void setExplicitLuceneMatchVersion(boolean isExplicitLuceneMatchVersion)
Copyright © 2000-2020 Apache Software Foundation. All Rights Reserved.