public class PorterStemmer extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
private char[] |
b |
private boolean |
dirty |
private static int |
EXTRA |
private int |
i |
private static int |
INC |
private int |
j |
private int |
k |
private int |
k0 |
| 构造器和说明 |
|---|
PorterStemmer() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
add(char ch)
Add a character to the word being stemmed.
|
private boolean |
cons(int i) |
private boolean |
cvc(int i) |
private boolean |
doublec(int j) |
private boolean |
ends(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(String[] args)
Test program for demonstrating the Stemmer.
|
(专用程序包) void |
r(String s) |
void |
reset()
reset() resets the stemmer so it can stem another word.
|
(专用程序包) void |
setto(String s) |
boolean |
stem()
Stem the word placed into the Stemmer buffer through calls to add().
|
boolean |
stem(char[] word)
Stem a word contained in a char[].
|
boolean |
stem(char[] word,
int wordLen)
Stem a word contained in a leading portion of a char[] array.
|
boolean |
stem(char[] wordBuffer,
int offset,
int wordLen)
Stem a word contained in a portion of a char[] array.
|
boolean |
stem(int i0) |
String |
stem(String s)
Stem a word provided as a String.
|
private void |
step1() |
private void |
step2() |
private void |
step3() |
private void |
step4() |
private void |
step5() |
private void |
step6() |
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() |
private char[] b
private int i
private int j
private int k
private int k0
private boolean dirty
private static final int INC
private static final int EXTRA
public void reset()
public void add(char ch)
public String toString()
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(String s)
void setto(String s)
void r(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 boolean stem(char[] word)
public boolean stem(char[] wordBuffer,
int offset,
int wordLen)
public boolean stem(char[] word,
int wordLen)
public boolean stem()
public boolean stem(int i0)
public static void main(String[] args) throws IOException
IOExceptionCopyright © 2023. All rights reserved.