Re: Porter Stemming Algorithm for PHP

From: Date: Sat, 16 Dec 2000 04:34:03 +0000
Subject: Re: Porter Stemming Algorithm for PHP
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-30652@lists.php.net to get a copy of this message
Send me links and I'll play with them or send me what to look for... --Joe On Fri, Dec 15, 2000 at 06:05:44PM -0800, Steve Edberg wrote: > Hi - > > Looks good...I had played around with this a year or so ago, but your > version looks a little neater than mine. One thing I was thinking about > adding, though, was a word exception list - for instance, the standard > Porter algorithm would turn 'waterbed' into 'waterb'. That wasn't a > big > problem for me, since I was dealing with a fairly limited vocabulary, but > it could lead to some weird results with an unrestricted word list. > > I suppose a more generalized stemmer would be a cool addition to PHP's > string functions, along with pspell, > soundex/metaphone/levenshtein/similar_text funcs and all that, but I don't > have any time in the near future to diddle with it... > > - steve > > > At 10:43 PM 12/14/00 , Joe Stump wrote: > >Well since I was bored last night and a few people have asked about this > >on the > >list over the past few weeks I thought I would post it. It's a port of the > >Porter Stemming Algorithm to PHP. It conforms to the algorithm rather > >well. The > >calculation of $m (the number of times a CV pair happens in sequence after > >initial C and before ending V) needs to be worked on, but other than that it > >works well. > > > >What is the Porter Stemming Algorithm? Well it takes "interesting" and turns > >it into "interest", "running" into "run", etc. You can get it > >at the following > >address: > > > >http://www.miester.org/software/ > > > >I've done some arbitrary tests and was able to run the function on the word > >"interesting", on average, 450 times a second. > > > +------------------------------------------------------------------------+ > | Steve Edberg University of California, Davis | > | sbedberg@ucdavis.edu (530)754-9127 | > | http://aesric.ucdavis.edu/ ¶ƒ+ø]Ú > ÇÑœù;Khttp://pgfsun.ucdavis.edu/ | > +---------------------- Gort, Klaatu barada nikto! ----------------------+ --- Joe Stump PHP Programmer www.Care2.com

« previous php.general (#30652) next »