masroore / php-stemmer
Native PHP Stemmer
v3.0.1
2022-06-12 14:13 UTC
Requires
- php: ^8.0 || ^8.1
- voku/portable-utf8: ^6.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.8
- nunomaduro/larastan: ^2.1
- pestphp/pest: ^1.21
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.1
- phpunit/phpunit: ^9.5
README
PHP native implementation of Snowball stemmer https://snowballstem.org/
Accept only UTF-8
Languages
Available :
- Catalan (by Orestes Sanchez Benavente orestes@estotienearreglo.es)
- Danish
- Dutch
- English
- Finnish (by Mikko Saari)
- French
- German
- Italian
- Norwegian
- Portuguese
- Romanian
- Russian
- Spanish
- Swedish
Installation
Requires PHP 8.0+
You can install the package via composer:
composer require masroore/php-stemmer
Usage
use Kaiju\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 Kaiju\Snowball\StemmerManager; $manager = new StemmerManager(); $stem = $manager->stem('automóvil', 'es');