|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.udo.cs.wvtool.external.Stemmer
public class Stemmer
Stemmer, implementing the Porter Stemming Algorithm 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 | |
---|---|
private char[] |
b
|
private int |
i
|
private int |
i_end
|
private static int |
INC
|
private int |
j
|
private int |
k
|
Constructor Summary | |
---|---|
Stemmer()
|
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. |
private boolean |
cons(int i)
|
private boolean |
cvc(int i)
|
private boolean |
doublec(int j)
|
private 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. |
private int |
m()
|
static void |
main(java.lang.String[] args)
Test program for demonstrating the Stemmer. |
private void |
r(java.lang.String s)
|
private void |
setto(java.lang.String s)
|
void |
stem()
Stem the word placed into the Stemmer buffer through calls to add(). |
private void |
step1()
|
private void |
step2()
|
private void |
step3()
|
private void |
step4()
|
private void |
step5()
|
private 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.) |
private boolean |
vowelinstem()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private char[] b
private int i
private int i_end
private int j
private int k
private static final int INC
Constructor Detail |
---|
public Stemmer()
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()
private final boolean cons(int i)
private final int m()
private final boolean vowelinstem()
private final boolean doublec(int j)
private final boolean cvc(int i)
private final boolean ends(java.lang.String s)
private final void setto(java.lang.String s)
private final void r(java.lang.String s)
private final void step1()
private final void step2()
private final void step3()
private final void step4()
private final void step5()
private final void step6()
public void stem()
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |