public class HunspellStemFilterFactory extends BaseTokenFilterFactory implements ResourceLoaderAware
HunspellStemFilter
.
Example config for British English including a custom dictionary, case insensitive matching:
<filter class="solr.HunspellStemFilterFactory" dictionary="en_GB.dic,my_custom.dic" affix="en_GB.aff" ignoreCase="true" />Both parameters dictionary and affix are mandatory.
Modifier and Type | Field and Description |
---|---|
protected Map<String,String> |
args
The init args
|
protected org.apache.lucene.util.Version |
luceneMatchVersion
the luceneVersion arg
|
log
Constructor and Description |
---|
HunspellStemFilterFactory() |
Modifier and Type | Method and Description |
---|---|
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 |
org.apache.lucene.analysis.TokenStream |
create(org.apache.lucene.analysis.TokenStream tokenStream)
Creates an instance of
HunspellStemFilter that will filter the given
TokenStream |
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 org.apache.lucene.analysis.CharArraySet |
getSnowballWordSet(ResourceLoader loader,
String wordFiles,
boolean ignoreCase)
same as
getWordSet(ResourceLoader, String, boolean) ,
except the input is in snowball format. |
protected org.apache.lucene.analysis.CharArraySet |
getWordSet(ResourceLoader loader,
String wordFiles,
boolean ignoreCase) |
void |
inform(ResourceLoader loader)
Loads the hunspell dictionary and affix files defined in the configuration
|
void |
init(Map<String,String> args) |
protected void |
warnDeprecated(String message) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getArgs, init
protected org.apache.lucene.util.Version luceneMatchVersion
public void inform(ResourceLoader loader)
inform
in interface ResourceLoaderAware
loader
- ResourceLoader used to load the filespublic org.apache.lucene.analysis.TokenStream create(org.apache.lucene.analysis.TokenStream tokenStream)
HunspellStemFilter
that will filter the given
TokenStreamcreate
in interface TokenFilterFactory
tokenStream
- TokenStream that will be filteredprotected 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 requiredprotected final void warnDeprecated(String message)
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 org.apache.lucene.analysis.CharArraySet getWordSet(ResourceLoader loader, String wordFiles, boolean ignoreCase) throws IOException
IOException
protected org.apache.lucene.analysis.CharArraySet getSnowballWordSet(ResourceLoader loader, String wordFiles, boolean ignoreCase) throws IOException
getWordSet(ResourceLoader, String, boolean)
,
except the input is in snowball format.IOException