public class TRv2PorterStemmer extends StemmerTermPipeline
Modifier and Type | Field and Description |
---|---|
protected char[] |
b
A buffer for word to be stemmed.
|
protected int |
j
A general offset into the string.
|
protected int |
k |
protected int |
k0 |
next
Constructor and Description |
---|
TRv2PorterStemmer(TermPipeline next)
Constructs an instance of the TRv2PorterStemmer.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
cons(int i)
cons(i) is TRUE <=> b[i] is a consonant.
|
protected boolean |
consonantinstem() |
protected boolean |
cvc(int i)
Returns true if i-2,i-1,i has the form consonant - vowel - consonant
and also if the second character is not w,x or y.
|
protected void |
defineBuffer(String s) |
protected boolean |
doublec(int _j)
Returns true if j,(j-1) contain a double consonant.
|
protected boolean |
ends(String s)
Returns true if k0,...k ends with the string s.
|
protected int |
m()
Measures the number of consonant sequences between k0 and j.
|
static void |
main(String[] args)
main
|
protected void |
setto(int i1,
int i2,
String str)
Sets (j+1),...k to the characters in the string s, readjusting
k and j.
|
String |
stem(String s)
Returns the stem of a given term
|
protected void |
step1ab()
Removes the plurals and -ed or -ing.
|
protected void |
step1c()
Turns terminal y to i when there is another vowel in the stem.
|
protected void |
step2()
Maps double suffices to single ones.
|
protected void |
step3()
Deals with -ic-, -full, -ness etc, similarly to the strategy of step2.
|
protected void |
step4()
Takes off -ant, -ence etc., in context
|
protected void |
step5()
Removes a final -e if m() > 1,
and changes -ll to -l if m() > 1.
|
protected boolean |
vowelinstem()
Returns TRUE if k0,...j contains a vowel.
|
processTerm, reset
protected char[] b
protected int k
protected int k0
protected int j
public TRv2PorterStemmer(TermPipeline next)
next
- protected boolean cons(int i)
protected boolean consonantinstem()
protected final boolean cvc(int i)
protected final void defineBuffer(String s)
protected final boolean doublec(int _j)
protected final boolean ends(String s)
protected final int m()
protected final void setto(int i1, int i2, String str)
public String stem(String s)
s
- String the term to be stemmed.protected final void step1ab()
protected final void step1c()
protected final void step2()
protected final void step3()
protected final void step4()
protected final void step5()
protected final boolean vowelinstem()
public static void main(String[] args)
args
- Terrier 4.0. Copyright © 2004-2014 University of Glasgow