|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectmoj.lang.en.PorterStemmer
public class PorterStemmer
For a definition of the Porter stemmer, see An algorithm for suffix stripping, Program, Vol 14 no 3 pp 130-137, July 1980. Also, the official implementation(s) can be found at: http://www.tartarus.org/~martin/PorterStemmer/
| Constructor Summary | |
|---|---|
PorterStemmer()
|
|
| Method Summary | |
|---|---|
static void |
main(java.lang.String[] args)
Usage: moj.lang.en.PorterStemmer <file> <file> : file to stem the words in |
java.lang.String |
removeNonWordChars(java.lang.String str)
Remove all characters except letters and digits from the given string. |
java.lang.String |
stripAffixes(java.lang.String word)
Removes all non-word characters from the given word and strips it (if possible) from English pre- and suffixes. |
java.lang.String |
stripPrefixes(java.lang.String str)
|
java.lang.String |
stripSuffixes(java.lang.String word)
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PorterStemmer()
| Method Detail |
|---|
public java.lang.String removeNonWordChars(java.lang.String str)
str - String to be cleansed from non-word characters
String cleansed from non-word characterspublic java.lang.String stripPrefixes(java.lang.String str)
str - the (possibly conjugated) word that is to be stripped from
(a few) English prefixes
public java.lang.String stripSuffixes(java.lang.String word)
word - the (possibly conjugated) word that is to be stemmed (e.g.
in this case stripped from English suffixes)
public java.lang.String stripAffixes(java.lang.String word)
word - the (possibly conjugated) word that is to be stemmed (e.g.
in this case stripped from English prefixes and suffixes)
public static void main(java.lang.String[] args)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||