step1a ( str -- newstr )
Porter stemming algorithm

Prev:stem ( str -- newstr )
Next:step1b ( str -- newstr )


Vocabulary
porter-stemmer

Inputs
stra string


Outputs
newstra new string


Word description
Gets rid of plurals.

Examples
InputOutput
caressescaress
poniesponi
tiesti
caresscaress
catscat


Definition


: step1a ( str -- newstr )
dup last 115 = [
{
{ [ "sses" ?tail ] [ "ss" append ] }
{ [ "ies" ?tail ] [ "i" append ] }
{ [ dup "ss" tail? ] [ ] }
{ [ "s" ?tail ] [ ] }
[ ]
} cond
] when ;