| java.lang.Object org.apache.lucene.analysis.PorterStemmer
PorterStemmer | class PorterStemmer (Code) | | 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.
|
Method Summary | |
public void | add(char ch) Add a character to the word being stemmed. | public char[] | getResultBuffer() Returns a reference to a character buffer containing the results of
the stemming process. | public int | getResultLength() Returns the length of the word resulting from the stemming process. | public static void | main(String[] args) Test program for demonstrating the Stemmer. | void | r(String s) | public void | reset() reset() resets the stemmer so it can stem another word. | void | setto(String s) | public String | stem(String s) Stem a word provided as a String. | public boolean | stem(char[] word) Stem a word contained in a char[]. | public boolean | stem(char[] wordBuffer, int offset, int wordLen) Stem a word contained in a portion of a char[] array. | public boolean | stem(char[] word, int wordLen) Stem a word contained in a leading portion of a char[] array.
Returns true if the stemming process resulted in a word different
from the input. | public boolean | stem() Stem the word placed into the Stemmer buffer through calls to add().
Returns true if the stemming process resulted in a word different
from the input. | public boolean | stem(int i0) | public String | toString() |
PorterStemmer | public PorterStemmer()(Code) | | |
add | public void add(char ch)(Code) | | Add a character to the word being stemmed. When you are finished
adding characters, you can call stem(void) to process the word.
|
getResultBuffer | public char[] getResultBuffer()(Code) | | Returns a reference to a character buffer containing the results of
the stemming process. You also need to consult getResultLength()
to determine the length of the result.
|
getResultLength | public int getResultLength()(Code) | | Returns the length of the word resulting from the stemming process.
|
main | public static void main(String[] args)(Code) | | Test program for demonstrating the Stemmer. It reads a file and
stems each word, writing the result to standard out.
Usage: Stemmer file-name
|
reset | public void reset()(Code) | | reset() resets the stemmer so it can stem another word. If you invoke
the stemmer by calling add(char) and then stem(), you must call reset()
before starting another word.
|
stem | public String stem(String s)(Code) | | Stem a word provided as a String. Returns the result as a String.
|
stem | public boolean stem(char[] word)(Code) | | Stem a word contained in a char[]. Returns true if the stemming process
resulted in a word different from the input. You can retrieve the
result with getResultLength()/getResultBuffer() or toString().
|
stem | public boolean stem(char[] wordBuffer, int offset, int wordLen)(Code) | | Stem a word contained in a portion of a char[] array. Returns
true if the stemming process resulted in a word different from
the input. You can retrieve the result with
getResultLength()/getResultBuffer() or toString().
|
stem | public boolean stem(char[] word, int wordLen)(Code) | | Stem a word contained in a leading portion of a char[] array.
Returns true if the stemming process resulted in a word different
from the input. You can retrieve the result with
getResultLength()/getResultBuffer() or toString().
|
stem | public boolean stem()(Code) | | Stem the word placed into the Stemmer buffer through calls to add().
Returns true if the stemming process resulted in a word different
from the input. You can retrieve the result with
getResultLength()/getResultBuffer() or toString().
|
stem | public boolean stem(int i0)(Code) | | |
toString | public String toString()(Code) | | 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.)
|
|
|