Jacson

de.spieleck.app.jacson.filter
Class StemmingFilter

java.lang.Object
  extended byde.spieleck.app.jacson.PluginBase
      extended byde.spieleck.app.jacson.filter.FilterBase
          extended byde.spieleck.app.jacson.filter.StemmingFilter
All Implemented Interfaces:
ConfigVerify.Acceptor, JacsonChunkDrain, JacsonFilter, JacsonRegistrable, JacsonReporting, JacsonStately

public class StemmingFilter
extends FilterBase
implements ConfigVerify.Acceptor

Filter to stemm a chunk. The returned chunks are either Strings representing the stemms or the String corresponding to the first word found connected with this particular stemm.

Author:
fsn

Nested Class Summary
static class StemmingFilter.Stat
           
 
Field Summary
protected  boolean returnWord
          Shall we return chunks which are words or stemms
protected  java.util.Map stats
          Map the equivalence classes of words to stemms.
protected  Stemmer stemmer
          The Stemmer to be used by this filter as a class
static java.lang.String STEMMER_NODE
          Config node to choose the stemmer
static java.lang.String STEMMER_PCK
          Defaultpackage for stemmers
protected  java.lang.String stemmerName
          The Stemmer to be used by this filter as a name
static java.lang.String WORD_NODE
          Config node to tell the stemmer to return representatives not stems
 
Fields inherited from class de.spieleck.app.jacson.filter.FilterBase
drain
 
Constructor Summary
StemmingFilter()
           
 
Method Summary
 boolean accept(ConfigNode node)
           
 Stemmer getStemmer(ConfigNode node, JacsonRegistry registry)
           
 void init(ConfigNode config, JacsonRegistry registry)
           
 void putChunk(java.lang.String chunk)
          Feed a single chunk into this filter
protected  java.lang.String statistic(java.lang.String old, java.lang.String stem)
           
 void summary()
          Do nothing default implementation
 
Methods inherited from class de.spieleck.app.jacson.filter.FilterBase
setDrain
 
Methods inherited from class de.spieleck.app.jacson.PluginBase
getRegReport, getRegState, registerReport, registerState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.spieleck.app.jacson.JacsonStately
registerState
 
Methods inherited from interface de.spieleck.app.jacson.JacsonReporting
registerReport
 

Field Detail

STEMMER_NODE

public static final java.lang.String STEMMER_NODE
Config node to choose the stemmer

See Also:
Constant Field Values

WORD_NODE

public static final java.lang.String WORD_NODE
Config node to tell the stemmer to return representatives not stems

See Also:
Constant Field Values

STEMMER_PCK

public static final java.lang.String STEMMER_PCK
Defaultpackage for stemmers

See Also:
Constant Field Values

stemmerName

protected java.lang.String stemmerName
The Stemmer to be used by this filter as a name


stemmer

protected Stemmer stemmer
The Stemmer to be used by this filter as a class


stats

protected java.util.Map stats
Map the equivalence classes of words to stemms.


returnWord

protected boolean returnWord
Shall we return chunks which are words or stemms

Constructor Detail

StemmingFilter

public StemmingFilter()
Method Detail

init

public void init(ConfigNode config,
                 JacsonRegistry registry)
          throws JacsonConfigException
Specified by:
init in interface JacsonRegistrable
Throws:
JacsonConfigException

accept

public boolean accept(ConfigNode node)
Specified by:
accept in interface ConfigVerify.Acceptor

putChunk

public void putChunk(java.lang.String chunk)
              throws JacsonException
Description copied from interface: JacsonChunkDrain
Feed a single chunk into this filter

Specified by:
putChunk in interface JacsonChunkDrain
Throws:
JacsonException

statistic

protected java.lang.String statistic(java.lang.String old,
                                     java.lang.String stem)

summary

public void summary()
Description copied from class: PluginBase
Do nothing default implementation

Specified by:
summary in interface JacsonReporting
Overrides:
summary in class PluginBase

getStemmer

public Stemmer getStemmer(ConfigNode node,
                          JacsonRegistry registry)
                   throws JacsonConfigException
Throws:
JacsonConfigException

Spieleck

Copyleft 2002 spieleck.de.