<div dir="ltr"><div><div><div><div><div><div>Hi all!<br><br></div>As you probably know, PHP had a few interfaces to Snowball compiled stemming algorithms: <br>- stem (<a href="https://pecl.php.net/package/stem">https://pecl.php.net/package/stem</a>);<br>- php-stemmer (<a href="https://code.google.com/archive/p/php-stemmer/">https://code.google.com/archive/p/php-stemmer/</a>);<br></div><div>- others...;<br></div><div>but these interfaces were written for PHP 4/5 using Zend extensions API.<br></div>Eventually PHP (since 7.4) introduced FFI (like Python or LUA) so now we can loading shared libraries, calling C functions and accessing C data structures
in pure PHP, without the burden of the Zend extension API.<br></div>So, I wrote a new interface largely inspired by Richard Boulton's PyStemmer and it is available via packagist: <a href="https://packagist.org/packages/amaccis/php-stemmer">https://packagist.org/packages/amaccis/php-stemmer</a>.<br></div>Besides I wrote a Dockerfile in order to create a Docker image with the env set-up needed by my library (I mean, PHP 7.4, FFI extension, libstemmer compiled like a shared library) and this image is available via DockerHub: <a href="https://hub.docker.com/r/amaccis/php-libstemmer">https://hub.docker.com/r/amaccis/php-libstemmer</a>.<br>I would appreciate any suggestions and comments, these are my repos: <br>- <a href="https://github.com/amaccis/php-stemmer">https://github.com/amaccis/php-stemmer</a><br>- <a href="https://github.com/amaccis/docker-php-libstemmer">https://github.com/amaccis/docker-php-libstemmer</a><br> I hope it can be useful.<br><br></div>Kind Regards,<br></div>Andrea Maccis<br><div><div><br></div></div></div>