tc
Class TCLancasterStemmer

java.lang.Object
  extended bytc.TCLancasterStemmer

public class TCLancasterStemmer
extends java.lang.Object

Class: Paice * * Purpose: Stemming Algorithm *


Field Summary
private  java.lang.String filerules
           
private  boolean preStrip
           
private  int[] ruleIndex
           
private  java.util.Vector ruleTable
           
 
Constructor Summary
TCLancasterStemmer(java.lang.String rules, java.lang.String pre)
          Method: Paice * * Purpose: init *
 
Method Summary
private  int charCode(char ch)
          Method: charCode * Returns: int * Recievs: char ch * Purpose: returns the relavent array index for * specified char 'a' to 'z' *
private  java.lang.String Clean(java.lang.String str)
          Method: Clean * Returns: String * Recievs: String str * Purpose: remove all non letter or digit * characters from srt and return *
private  int FirstVowel(java.lang.String word, int last)
          Method: FirstVowel * Returns: int * Recievs: String word, int last * Purpose: checks lower-case word for position of * the first vowel *
private  void ReadRules(java.lang.String stemRules)
          Method: ReadRules * Returns: void * Receives: * Purpose: read rules in from stemRules and enters them * into ruleTable, ruleIndex is set up to provide * faster access to relevant rules.
 java.lang.String stripAffixes(java.lang.String str)
          Method: stripAffixes * Returns: String * Recievs: String str * Purpose: prepares string and calls stripPrefixes * and stripSuffixes *
private  java.lang.String stripPrefixes(java.lang.String str)
          Method: stripPrefixes * Returns: String * Recievs: String str * Purpose: removes prefixes so that suffix * removal can comence *
private  java.lang.String stripSuffixes(java.lang.String word)
          Method: stripSuffixes * Returns: String * Recievs: String word * Purpose: strips suffix off word and returns stem using * paice stemming algorithm *
private  boolean vowel(char ch, char prev)
          Method: vowel * Returns: boolean * Recievs: char ch, char prev * Purpose: determin whether ch is a vowel or not * uses prev determination when ch == y *
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ruleTable

private java.util.Vector ruleTable

ruleIndex

private int[] ruleIndex

preStrip

private boolean preStrip

filerules

private java.lang.String filerules
Constructor Detail

TCLancasterStemmer

public TCLancasterStemmer(java.lang.String rules,
                          java.lang.String pre)
Method: Paice * * Purpose: init *

Method Detail

ReadRules

private void ReadRules(java.lang.String stemRules)
Method: ReadRules * Returns: void * Receives: * Purpose: read rules in from stemRules and enters them * into ruleTable, ruleIndex is set up to provide * faster access to relevant rules. *


FirstVowel

private int FirstVowel(java.lang.String word,
                       int last)
Method: FirstVowel * Returns: int * Recievs: String word, int last * Purpose: checks lower-case word for position of * the first vowel *


stripSuffixes

private java.lang.String stripSuffixes(java.lang.String word)
Method: stripSuffixes * Returns: String * Recievs: String word * Purpose: strips suffix off word and returns stem using * paice stemming algorithm *


vowel

private boolean vowel(char ch,
                      char prev)
Method: vowel * Returns: boolean * Recievs: char ch, char prev * Purpose: determin whether ch is a vowel or not * uses prev determination when ch == y *


charCode

private int charCode(char ch)
Method: charCode * Returns: int * Recievs: char ch * Purpose: returns the relavent array index for * specified char 'a' to 'z' *


stripPrefixes

private java.lang.String stripPrefixes(java.lang.String str)
Method: stripPrefixes * Returns: String * Recievs: String str * Purpose: removes prefixes so that suffix * removal can comence *


Clean

private java.lang.String Clean(java.lang.String str)
Method: Clean * Returns: String * Recievs: String str * Purpose: remove all non letter or digit * characters from srt and return *


stripAffixes

public java.lang.String stripAffixes(java.lang.String str)
Method: stripAffixes * Returns: String * Recievs: String str * Purpose: prepares string and calls stripPrefixes * and stripSuffixes *