edu.udo.cs.wvtool.generic.stemmer
Class AbstractStemmer

java.lang.Object
  extended by edu.udo.cs.wvtool.generic.stemmer.AbstractStemmer
All Implemented Interfaces:
SimpleStemmer, WVTStemmer, TokenEnumeration
Direct Known Subclasses:
AbstractWordNetStemmer, DictionaryStemmer, DummyStemmer, LovinsStemmerWrapper, PorterStemmerWrapper, SnowballStemmerWrapper, ToLowerCaseConverter

public abstract class AbstractStemmer
extends java.lang.Object
implements WVTStemmer, SimpleStemmer, TokenEnumeration

An abstract stemmer.

Version:
$Id$
Author:
Michael Wurst

Field Summary
private  TokenEnumeration source
           
 
Constructor Summary
AbstractStemmer()
           
 
Method Summary
abstract  java.lang.String getBase(java.lang.String s)
          Produce the base form of a given term.
 boolean hasMoreTokens()
          Determine whether there are tokens left in the Enumeration.
 java.lang.String nextToken()
          Return the next token from the stream.
 TokenEnumeration stem(TokenEnumeration source, WVTDocumentInfo d)
          Convert a list of tokens to a list of stems.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

source

private TokenEnumeration source
Constructor Detail

AbstractStemmer

public AbstractStemmer()
Method Detail

stem

public TokenEnumeration stem(TokenEnumeration source,
                             WVTDocumentInfo d)
                      throws WVToolException
Description copied from interface: WVTStemmer
Convert a list of tokens to a list of stems.

Specified by:
stem in interface WVTStemmer
Parameters:
source - the original stream of tokens
d - the WVTDocumentInfo value that describes the document being processed
Returns:
the resulting stream of tokens
Throws:
WVToolException


nextToken

public java.lang.String nextToken()
                           throws WVToolException
Description copied from interface: TokenEnumeration
Return the next token from the stream.

Specified by:
nextToken in interface TokenEnumeration
Returns:
a String value, or null if there are no more tokens
Throws:
WVToolException


getBase

public abstract java.lang.String getBase(java.lang.String s)
Description copied from interface: SimpleStemmer
Produce the base form of a given term.

Specified by:
getBase in interface SimpleStemmer
Parameters:
s - a term
Returns:
the base form of the term


hasMoreTokens

public boolean hasMoreTokens()
Description copied from interface: TokenEnumeration
Determine whether there are tokens left in the Enumeration. If an error occurs, false is returned.

Specified by:
hasMoreTokens in interface TokenEnumeration
Returns:
a boolean value