|
Terrier IR Platform 2.2.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object uk.ac.gla.terrier.terms.PorterStemmer
public class PorterStemmer
This is the Porter stemming algorithm, coded up in JAVA by Gianni Amati.
All comments were made by Porter, but few ones due to some implementation
choices.
Porter says "It may be be regarded as cononical, in that it follows the
algorithm presented in Porter, 1980, An algorithm for suffix stripping,
Program, Vol. 14, no. 3, pp 130-137, only differing from it at the
points marked --DEPARTURE-- below. The algorithm as described in the
paper could be exactly replicated by adjusting the points of DEPARTURE,
but this is barely necessary, because (a) the points of DEPARTURE are
definitely improvements, and (b) no encoding of the Porter stemmer I
have seen is anything like as exact as this version, even with the
points of DEPARTURE!".
This class is not thread safe.
Field Summary | |
---|---|
static char[] |
b
A buffer for word to be stemmed. |
Constructor Summary | |
---|---|
PorterStemmer(TermPipeline next)
Constructs an instance of the class, given the next component in the pipeline. |
Method Summary | |
---|---|
static void |
main(java.lang.String[] args)
|
void |
processTerm(java.lang.String t)
Stems the given term. |
java.lang.String |
stem(java.lang.String s)
Returns the stem of a given term |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static char[] b
Constructor Detail |
---|
public PorterStemmer(TermPipeline next)
next
- TermPipeline the next component in
the term pipeline.Method Detail |
---|
public void processTerm(java.lang.String t)
processTerm
in interface TermPipeline
t
- String the term to stem.public java.lang.String stem(java.lang.String s)
s
- String the term to be stemmed.
public static void main(java.lang.String[] args)
|
Terrier IR Platform 2.2.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |