I've tried PorterStemmer and Snowball but both don't work on all words, missing some very common ones.
My test words are: "cats running ran cactus cactuses community communities", and both get less than half right.
Ideally the class/function would be in PHP, but I can port it if it's in another language.
See also: