|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.aitools.ie.stemming.PorterStemmer
public class PorterStemmer
Implementation of the Porter Stemming Algorithm.
This class transforms a word into its root form. The input word can be provided a character at time (by calling add()), or at once by calling one of the various stem(something) methods, or process(String) respectively.
Author Martin Porter, Source: http://www.tartarus.org/~martin/PorterStemmer.
Modified by webis:
- Method process(String) added to implement the Stemmer interface.
Constructor Summary | |
---|---|
PorterStemmer()
|
Method Summary | |
---|---|
void |
add(char ch)
Add a character to the word being stemmed. |
void |
add(char[] w,
int wLen)
Adds wLen characters to the word being stemmed contained in a portion of a char[] array. |
char[] |
getResultBuffer()
Returns a reference to a character buffer containing the results of the stemming process. |
int |
getResultLength()
Returns the length of the word resulting from the stemming process. |
static void |
main(java.lang.String[] args)
Test program for demonstrating the Stemmer. |
java.lang.String |
process(java.lang.String word)
Builds the stem of the specified word. |
void |
stem()
Stem the word placed into the Stemmer buffer through calls to add(). |
java.lang.String |
toString()
After a word has been stemmed, it can be retrieved by toString(), or a reference to the internal buffer can be retrieved by getResultBuffer and getResultLength (which is generally more efficient.) |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public PorterStemmer()
Method Detail |
---|
public void add(char ch)
public void add(char[] w, int wLen)
public java.lang.String toString()
toString
in class java.lang.Object
public int getResultLength()
public char[] getResultBuffer()
public void stem()
public java.lang.String process(java.lang.String word)
Stemmer
process
in interface Stemmer
word
- Word to be stemmed.
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |