Handbook
Glossary
-ed/ing ( str -- str )
Vocabulary
porter-stemmer
Inputs
str
an
object
Outputs
str
an
object
Definition
USING:
combinators
kernel
math
sequences
splitting
;
IN:
porter-stemmer
:
-ed/ing
( str -- str )
{
{
[
"at"
?tail
]
[
"ate"
append
]
}
{
[
"bl"
?tail
]
[
"ble"
append
]
}
{
[
"iz"
?tail
]
[
"ize"
append
]
}
{
[
dup
length
1
-
over
double-consonant?
]
[
dup
"lsz"
last-is?
[
but-last-slice
]
unless
]
}
{
[
t
]
[
dup
consonant-seq
1
=
over
cvc?
and
[
"e"
append
]
when
]
}
}
cond
;