Handbook
Glossary
step1a ( str -- newstr )
Porter stemming algorithm
Prev:
stem ( str -- newstr )
Next:
step1b ( str -- newstr )
Vocabulary
porter-stemmer
Inputs
str
a
string
Outputs
newstr
a new string
Word description
Gets rid of plurals.
Examples
Input
Output
caresses
caress
ponies
poni
ties
ti
caress
caress
cats
cat
Definition
USING:
combinators
kernel
sequences
splitting
;
IN:
porter-stemmer
:
step1a
( str -- newstr )
dup
last
115
=
[
{
{
[
"sses"
?tail
]
[
"ss"
append
]
}
{
[
"ies"
?tail
]
[
"i"
append
]
}
{
[
dup
"ss"
tail?
]
[
]
}
{
[
"s"
?tail
]
[
]
}
[
]
}
cond
]
when
;