org.apache.solr.analysis
Class SnowballPorterFilterFactory

java.lang.Object
  extended by org.apache.solr.analysis.BaseTokenFilterFactory
      extended by org.apache.solr.analysis.SnowballPorterFilterFactory
All Implemented Interfaces:
TokenFilterFactory, ResourceLoaderAware

public class SnowballPorterFilterFactory
extends BaseTokenFilterFactory
implements ResourceLoaderAware

Factory for SnowballFilters, with configurable language

Browsing the code, SnowballFilter uses reflection to adapt to Lucene... don't use this if you are concerned about speed. Use EnglishPorterFilterFactory.

Version:
$Id: SnowballPorterFilterFactory.java 804726 2009-08-16 17:28:58Z yonik $

Field Summary
protected  java.util.Map<java.lang.String,java.lang.String> args
          The init args
protected  org.apache.lucene.util.Version luceneMatchVersion
          the luceneVersion arg
static java.lang.String PROTECTED_TOKENS
           
 
Fields inherited from class org.apache.solr.analysis.BaseTokenFilterFactory
log
 
Constructor Summary
SnowballPorterFilterFactory()
           
 
Method Summary
protected  void assureMatchVersion()
          this method can be called in the #create method, to inform user, that for this factory a luceneMatchVersion is required
 org.apache.solr.analysis.SnowballPorterFilter create(org.apache.lucene.analysis.TokenStream input)
          Transform the specified input TokenStream
 java.util.Map<java.lang.String,java.lang.String> getArgs()
           
protected  boolean getBoolean(java.lang.String name, boolean defaultVal)
           
protected  boolean getBoolean(java.lang.String name, boolean defaultVal, boolean useDefault)
           
protected  int getInt(java.lang.String name)
           
protected  int getInt(java.lang.String name, int defaultVal)
           
protected  int getInt(java.lang.String name, int defaultVal, boolean useDefault)
           
protected  org.apache.lucene.analysis.CharArraySet getWordSet(ResourceLoader loader, java.lang.String wordFiles, boolean ignoreCase)
           
 void inform(ResourceLoader loader)
           
 void init(java.util.Map<java.lang.String,java.lang.String> args)
          init will be called just once, immediately after creation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.solr.analysis.TokenFilterFactory
getArgs
 

Field Detail

PROTECTED_TOKENS

public static final java.lang.String PROTECTED_TOKENS
See Also:
Constant Field Values

args

protected java.util.Map<java.lang.String,java.lang.String> args
The init args


luceneMatchVersion

protected org.apache.lucene.util.Version luceneMatchVersion
the luceneVersion arg

Constructor Detail

SnowballPorterFilterFactory

public SnowballPorterFilterFactory()
Method Detail

inform

public void inform(ResourceLoader loader)
Specified by:
inform in interface ResourceLoaderAware

init

public void init(java.util.Map<java.lang.String,java.lang.String> args)
Description copied from interface: TokenFilterFactory
init will be called just once, immediately after creation.

The args are user-level initialization parameters that may be specified when declaring the factory in the schema.xml

Specified by:
init in interface TokenFilterFactory

create

public org.apache.solr.analysis.SnowballPorterFilter create(org.apache.lucene.analysis.TokenStream input)
Description copied from interface: TokenFilterFactory
Transform the specified input TokenStream

Specified by:
create in interface TokenFilterFactory

getArgs

public java.util.Map<java.lang.String,java.lang.String> getArgs()

assureMatchVersion

protected final void assureMatchVersion()
this method can be called in the #create method, to inform user, that for this factory a luceneMatchVersion is required


getInt

protected int getInt(java.lang.String name)

getInt

protected int getInt(java.lang.String name,
                     int defaultVal)

getInt

protected int getInt(java.lang.String name,
                     int defaultVal,
                     boolean useDefault)

getBoolean

protected boolean getBoolean(java.lang.String name,
                             boolean defaultVal)

getBoolean

protected boolean getBoolean(java.lang.String name,
                             boolean defaultVal,
                             boolean useDefault)

getWordSet

protected org.apache.lucene.analysis.CharArraySet getWordSet(ResourceLoader loader,
                                                             java.lang.String wordFiles,
                                                             boolean ignoreCase)
                                                      throws java.io.IOException
Throws:
java.io.IOException


Copyright © 2006-2010 Hibernate. All Rights Reserved.