public class PorterStemmer extends java.lang.Object implements Stemmer
Martin Porter, An algorithm for suffix stripping, Program, 14(3), 130-137, 1980.
Note that this class is NOT multi-thread safe. The code is based on http://www.tartarus.org/~martin/PorterStemmer History: Release 1 Bug 1 (reported by Gonzalo Parra 16/10/99) fixed as marked below. The words 'aed', 'eed', 'oed' leave k at 'a' for step 3, and b[k-1] is then out outside the bounds of b. Release 2 Similarly, Bug 2 (reported by Steve Dyrdahl 22/2/00) fixed as marked below. 'ion' by itself leaves j = -1 in the test for 'ion' in step 5, and b[j] is then outside the bounds of b. Release 3 Considerably revised 4/9/00 in the light of many helpful suggestions from Brian Goetz of Quiotix Corporation (brian@quiotix.com). Release 4
| Constructor and Description |
|---|
PorterStemmer()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
stem(java.lang.String word)
Transforms a word into its root form.
|
java.lang.String |
stripPluralParticiple(java.lang.String word)
Remove plurals and participles.
|
public java.lang.String stem(java.lang.String word)
Stemmerpublic java.lang.String stripPluralParticiple(java.lang.String word)