public class SnowballPorterFilterFactory extends TokenFilterFactory implements ResourceLoaderAware
SnowballFilter
, with configurable language
Note: Use of the "Lovins" stemmer is not recommended, as it is implemented with reflection.
<fieldType name="text_snowballstem" class="solr.TextField" positionIncrementGap="100"> <analyzer> <tokenizer class="solr.StandardTokenizerFactory"/> <filter class="solr.LowerCaseFilterFactory"/> <filter class="solr.SnowballPorterFilterFactory" protected="protectedkeyword.txt" language="English"/> </analyzer> </fieldType>
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
language |
static java.lang.String |
PROTECTED_TOKENS |
private CharArraySet |
protectedWords |
private java.lang.Class<? extends SnowballProgram> |
stemClass |
private java.lang.String |
wordFiles |
LUCENE_MATCH_VERSION_PARAM, luceneMatchVersion
Constructor and Description |
---|
SnowballPorterFilterFactory(java.util.Map<java.lang.String,java.lang.String> args)
Creates a new SnowballPorterFilterFactory
|
Modifier and Type | Method and Description |
---|---|
TokenFilter |
create(TokenStream input)
Transform the specified input TokenStream
|
void |
inform(ResourceLoader loader)
Initializes this component with the provided ResourceLoader
(used for loading classes, files, etc).
|
availableTokenFilters, forName, lookupClass, normalize, reloadTokenFilters
get, get, get, get, get, getBoolean, getChar, getClassArg, getFloat, getInt, getLines, getLuceneMatchVersion, getOriginalArgs, getPattern, getSet, getSnowballWordSet, getWordSet, isExplicitLuceneMatchVersion, require, require, require, requireBoolean, requireChar, requireFloat, requireInt, setExplicitLuceneMatchVersion, splitAt, splitFileNames
public static final java.lang.String PROTECTED_TOKENS
private final java.lang.String language
private final java.lang.String wordFiles
private java.lang.Class<? extends SnowballProgram> stemClass
private CharArraySet protectedWords
public SnowballPorterFilterFactory(java.util.Map<java.lang.String,java.lang.String> args)
public void inform(ResourceLoader loader) throws java.io.IOException
ResourceLoaderAware
inform
in interface ResourceLoaderAware
java.io.IOException
public TokenFilter create(TokenStream input)
TokenFilterFactory
create
in class TokenFilterFactory