Class HunspellStemFilterFactory
java.lang.Object
org.apache.lucene.analysis.util.AbstractAnalysisFactory
org.apache.lucene.analysis.util.TokenFilterFactory
org.apache.lucene.analysis.hunspell.HunspellStemFilterFactory
- All Implemented Interfaces:
ResourceLoaderAware
TokenFilterFactory that creates instances of
The parameter ignoreCase (true/false) controls whether matching is case sensitive or not. Default false.
The parameter strictAffixParsing (true/false) controls whether the affix parsing is strict or not. Default true. If strict an error while reading an affix rule causes a ParseException, otherwise is ignored.
Dictionaries for many languages are available through the OpenOffice project. See http://wiki.apache.org/solr/Hunspell
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.
The parameter ignoreCase (true/false) controls whether matching is case sensitive or not. Default false.
The parameter strictAffixParsing (true/false) controls whether the affix parsing is strict or not. Default true. If strict an error while reading an affix rule causes a ParseException, otherwise is ignored.
Dictionaries for many languages are available through the OpenOffice project. See http://wiki.apache.org/solr/Hunspell
-
Field Summary
Fields inherited from class org.apache.lucene.analysis.util.AbstractAnalysisFactory
LUCENE_MATCH_VERSION_PARAM -
Constructor Summary
ConstructorsConstructorDescriptionHunspellStemFilterFactory(Map<String, String> args) Creates a new HunspellStemFilterFactory -
Method Summary
Modifier and TypeMethodDescriptioncreate(TokenStream tokenStream) Creates an instance ofHunspellStemFilterthat will filter the given TokenStreamvoidinform(ResourceLoader loader) Loads the hunspell dictionary and affix files defined in the configurationMethods inherited from class org.apache.lucene.analysis.util.TokenFilterFactory
availableTokenFilters, forName, lookupClass, reloadTokenFiltersMethods 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
-
Constructor Details
-
HunspellStemFilterFactory
Creates a new HunspellStemFilterFactory
-
-
Method Details
-
inform
Loads the hunspell dictionary and affix files defined in the configuration- Specified by:
informin interfaceResourceLoaderAware- Parameters:
loader- ResourceLoader used to load the files- Throws:
IOException
-
create
Creates an instance ofHunspellStemFilterthat will filter the given TokenStream- Specified by:
createin classTokenFilterFactory- Parameters:
tokenStream- TokenStream that will be filtered- Returns:
- HunspellStemFilter that filters the TokenStream
-