ptstemmer
Class Stemmer

java.lang.Object
  extended by ptstemmer.Stemmer
Direct Known Subclasses:
OrengoStemmer, PorterStemmer, SavoyStemmer

public abstract class Stemmer
extends java.lang.Object

Abstract class that provides the main features to all the stemmers

Author:
Pedro Oliveira

Nested Class Summary
static class Stemmer.StemmerType
           
 
Constructor Summary
Stemmer()
           
 
Method Summary
 void clearIgnoreList()
          Clear the contents of the ignore list
 void disableCaching()
          Disable and delete the LRU Cache
 void enableCaching(int size)
          Create a LRU Cache, caching the last size stems
 java.lang.String[] getPhraseStems(java.lang.String phrase)
          Performs stemming on the phrase, using a simple space tokenizer
 java.lang.String getWordStem(java.lang.String word)
          Performs stemming on the word
 void ignore(java.util.Collection<java.lang.String> words)
          Add Collection of words to ignore list
 void ignore(java.lang.String... words)
          Add list of words to ignore list
 boolean isCachingEnabled()
          Check if LRU Cache is enabled
static Stemmer StemmerFactory(Stemmer.StemmerType stype)
          Stemmer construction factory
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Stemmer

public Stemmer()
Method Detail

StemmerFactory

public static Stemmer StemmerFactory(Stemmer.StemmerType stype)
                              throws PTStemmerException
Stemmer construction factory

Parameters:
stype -
Returns:
Throws:
PTStemmerException

enableCaching

public void enableCaching(int size)
Create a LRU Cache, caching the last size stems

Parameters:
size -

disableCaching

public void disableCaching()
Disable and delete the LRU Cache


isCachingEnabled

public boolean isCachingEnabled()
Check if LRU Cache is enabled

Returns:

ignore

public void ignore(java.lang.String... words)
Add list of words to ignore list

Parameters:
words -

ignore

public void ignore(java.util.Collection<java.lang.String> words)
Add Collection of words to ignore list

Parameters:
words -

clearIgnoreList

public void clearIgnoreList()
Clear the contents of the ignore list


getPhraseStems

public java.lang.String[] getPhraseStems(java.lang.String phrase)
Performs stemming on the phrase, using a simple space tokenizer

Parameters:
phrase -
Returns:

getWordStem

public java.lang.String getWordStem(java.lang.String word)
Performs stemming on the word

Parameters:
word -
Returns: