PHP native implementation of Snowball stemmer https://snowballstem.org/
Accept only UTF-8
Available :
- Catalan (by Orestes Sanchez Benavente [email protected])
- Danish
- Dutch
- English
- Finnish (by Mikko Saari)
- French
- German
- Italian
- Norwegian
- Portuguese
- Romanian
- Russian
- Spanish
- Swedish
For PHP^7.3 and PHP^8.0 use 3.x (backward compatible, but phpunit^9 don't work with php < 7.3)
composer require burhanmt/php-stemmer "^3.0"
For 2.x, you should use the factory
use Wamania\Snowball\StemmerFactory;
// use ISO_639 (2 or 3 letters) or language name in english
$stemmer = StemmerFactory::create('fr');
$stemmer = StemmerFactory::create ('spanish');
// then
$stem = $stemmer->stem('automóvil');
Or the manager
use Wamania\Snowball\StemmerManager;
$manager = new StemmerManager();
$stem = $manager->stem('automóvil', 'es');