2
votes

stem('apples')='apple'
stem('apple')='appl'
stem('appl')='appl'

isn't this a flaw in the stemming algorithm?

(this is using the Porter Stemming Algorithm)

2

2 Answers

1
votes

That looks more like a bug in the implementation of the algorithm you're using.

When I follow the steps in the original algorithm (from the page you linked to), the final "s" from "apples" is removed in step 1a, and the "e" in step 5a, so the stem of "apples" is also "appl".

0
votes

I found an implementation of porter stemming algorithm with a dictionary support here http://preciselyconcise.com/apis_and_installations/smart_stemmer.php.

This API was really simple to use and the stemmed words were corrected for mistakes in spelling. I would suggest you using this stemmer since this API has an auto correct option of the stemmed words.