|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.lucene.analysis.util.AbstractAnalysisFactory
public abstract class AbstractAnalysisFactory
Abstract parent class for analysis factories TokenizerFactory
,
TokenFilterFactory
and CharFilterFactory
.
The typical lifecycle for a factory consumer is:
setLuceneMatchVersion(Version)
init(Map)
passing arguments as key-value mappings.
ResourceLoaderAware.inform(ResourceLoader)
is called to initialize those resources.
Field Summary | |
---|---|
protected Map<String,String> |
args
The init args |
protected Version |
luceneMatchVersion
the luceneVersion arg |
Constructor Summary | |
---|---|
AbstractAnalysisFactory()
|
Method Summary | |
---|---|
protected void |
assureMatchVersion()
this method can be called in the TokenizerFactory.create(java.io.Reader)
or TokenFilterFactory.create(org.apache.lucene.analysis.TokenStream) methods,
to inform user, that for this factory a luceneMatchVersion is required |
Map<String,String> |
getArgs()
|
protected boolean |
getBoolean(String name,
boolean defaultVal)
|
protected boolean |
getBoolean(String name,
boolean defaultVal,
boolean useDefault)
|
protected int |
getInt(String name)
|
protected int |
getInt(String name,
int defaultVal)
|
protected int |
getInt(String name,
int defaultVal,
boolean useDefault)
|
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(String name)
Compiles a pattern for the value of the specified argument key name |
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 |
void |
init(Map<String,String> args)
Initialize this factory via a set of key-value pairs. |
void |
setLuceneMatchVersion(Version luceneMatchVersion)
|
protected List<String> |
splitFileNames(String fileNames)
Splits file names separated by comma character. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Map<String,String> args
protected Version luceneMatchVersion
Constructor Detail |
---|
public AbstractAnalysisFactory()
Method Detail |
---|
public void init(Map<String,String> args)
public Map<String,String> getArgs()
public Map<String,String> getOriginalArgs()
protected final void assureMatchVersion()
TokenizerFactory.create(java.io.Reader)
or TokenFilterFactory.create(org.apache.lucene.analysis.TokenStream)
methods,
to inform user, that for this factory a luceneMatchVersion
is required
public void setLuceneMatchVersion(Version luceneMatchVersion)
public Version getLuceneMatchVersion()
protected int getInt(String name)
protected int getInt(String name, int defaultVal)
protected int getInt(String name, int defaultVal, boolean useDefault)
protected boolean getBoolean(String name, boolean defaultVal)
protected boolean getBoolean(String name, boolean defaultVal, boolean useDefault)
protected Pattern getPattern(String name)
name
protected CharArraySet getWordSet(ResourceLoader loader, String wordFiles, boolean ignoreCase) throws IOException
CharArraySet
from wordFiles, which
can be a comma-separated list of filenames
IOException
protected List<String> getLines(ResourceLoader loader, String resource) throws IOException
IOException
protected CharArraySet getSnowballWordSet(ResourceLoader loader, String wordFiles, boolean ignoreCase) throws IOException
getWordSet(ResourceLoader, String, boolean)
,
except the input is in snowball format.
IOException
protected List<String> splitFileNames(String fileNames)
fileNames
- the string containing file names
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |