lempinen.neatseeker.stemmer
Class charvec
java.lang.Object
|
+--lempinen.neatseeker.stemmer.charvec
- public class charvec
- extends java.lang.Object
Dr. Martin Porter's stemmer for English.
All code in this class is from Dr. Porter. All credit goes to the
original author. The original header is included below.
Porter stemmer in Java. The original paper is in
Porter, 1980, An algorithm for suffix stripping, Program, Vol. 14,
no. 3, pp 130-137,
See also http://www.muscat.com/~martin/stem.html
Bug 1 (reported by Gonzalo Parra 16/10/99) fixed as marked below.
Tthe words 'aed', 'eed', 'oed' leave k at 'a' for step 3, and b[k-1]
is then out outside the bounds of b.
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.
- Version:
- $Id: charvec.java,v 1.1.1.1 2000/09/23 07:29:27 lempinen Exp $
- Author:
- Sami Lempinen
Field Summary |
char[] |
b
|
private int |
i
|
private static int |
INC
|
private int |
j
|
private int |
k
|
private int |
k0
|
Method Summary |
void |
add(char ch)
|
private boolean |
cons(int i)
|
private boolean |
cvc(int i)
|
private boolean |
doublec(int j)
|
private boolean |
ends(java.lang.String s)
|
private int |
m()
|
(package private) void |
r(java.lang.String s)
|
void |
reset()
|
(package private) void |
setto(java.lang.String s)
|
void |
stem(int i0)
|
private void |
step1()
|
private void |
step2()
|
private void |
step3()
|
private void |
step4()
|
private void |
step5()
|
private void |
step6()
|
java.lang.String |
toString()
|
private boolean |
vowelinstem()
|
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait |
b
public char[] b
i
private int i
j
private int j
k
private int k
k0
private int k0
INC
private static final int INC
charvec
public charvec()
reset
public void reset()
add
public void add(char ch)
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
cons
private boolean cons(int i)
m
private int m()
vowelinstem
private boolean vowelinstem()
doublec
private boolean doublec(int j)
cvc
private boolean cvc(int i)
ends
private boolean ends(java.lang.String s)
setto
void setto(java.lang.String s)
r
void r(java.lang.String s)
step1
private void step1()
step2
private void step2()
step3
private void step3()
step4
private void step4()
step5
private void step5()
step6
private void step6()
stem
public void stem(int i0)