|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.terrier.terms.StemmerTermPipeline org.terrier.terms.PorterStemmer
public class PorterStemmer
Stemmer, implementing the Porter Stemming Algorithm. By Martin Porter. The Stemmer 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.
Field Summary | |
---|---|
protected char[] |
b
|
protected int |
i
|
protected int |
i_end
|
protected static int |
INC
|
protected int |
j
|
protected int |
k
|
Fields inherited from class org.terrier.terms.StemmerTermPipeline |
---|
next |
Constructor Summary | |
---|---|
PorterStemmer()
constructor |
|
PorterStemmer(TermPipeline next)
Constructs an instance of 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. |
protected boolean |
cons(int _i)
|
protected boolean |
cvc(int _i)
|
protected boolean |
doublec(int _j)
|
protected boolean |
ends(java.lang.String s)
|
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. |
protected int |
m()
|
static void |
main(java.lang.String[] args)
Test program for demonstrating the Stemmer. |
protected void |
r(java.lang.String s)
|
protected void |
setto(java.lang.String s)
|
void |
stem()
Stem the word placed into the Stemmer buffer through calls to add(). |
java.lang.String |
stem(java.lang.String s)
Returns the stem of a given term |
protected void |
step1()
|
protected void |
step2()
|
protected void |
step3()
|
protected void |
step4()
|
protected void |
step5()
|
protected void |
step6()
|
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.) |
protected boolean |
vowelinstem()
|
Methods inherited from class org.terrier.terms.StemmerTermPipeline |
---|
processTerm, reset |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected char[] b
protected int i
protected int i_end
protected int j
protected int k
protected static final int INC
Constructor Detail |
---|
public PorterStemmer()
public PorterStemmer(TermPipeline next)
next
- 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()
protected final boolean cons(int _i)
protected final int m()
protected final boolean vowelinstem()
protected final boolean doublec(int _j)
protected final boolean cvc(int _i)
protected final boolean ends(java.lang.String s)
protected final void setto(java.lang.String s)
protected final void r(java.lang.String s)
protected final void step1()
protected final void step2()
protected final void step3()
protected final void step4()
protected final void step5()
protected final void step6()
public void stem()
public static void main(java.lang.String[] args)
public java.lang.String stem(java.lang.String s)
s
- String the term to be stemmed.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |