If you do not know what a stemmer is, the article on Wikipedia is self explanatory. Basically, it allows a computer program to find a common root for different forms of the same word. While Dr. Porter did a great job creating stemmers for different languages and the Snowball API, it was not available directly from a PHP script.
Now that this limitation is gone, you might want to try using the stemmer to create an intelligent search engine for your website. If you want to give it a try, issue the following command on your favorite UNIX based machine:
pecl install stem. Once the installation has completed, you might want to modify your
php.ini to load the extension and then try the following example:
<?php print stem_english('cleaner') ."\n"; print stem_french('épouses') ."\n"; ?>
This would output
épous respectively. In some cases, the word outputed by the stemmer will not exist in a dictionary, but this is rarely a problem. In fact, you should only stem words to use them as keywords in some kind of database.
pecl), you might encounter an error like this snippet:
bender ~ # pecl install apc downloading APC-3.0.8.tgz ... [...] autoconf: Undefined macros: configure.in:63:AC_PROG_LIBTOOL ERROR: `phpize' failed
The main problem lies with the use of automake v1.9.x. Since Gentoo comes with a bunch of different versions of the autotools, you can choose to use automake v1.8, which will result in a complete built.
bender ~ # WANT_AUTOMAKE="1.8" pecl install apc
As simple as it seems, it took me a while to fix it. Let me know if this helps.