Stemming by Language

1.1.4 2023-01-11 15:38 UTC

This package is auto-updated.

Last update: 2023-11-11 17:30:34 UTC


Tests Latest Stable Version Total Downloads

The main purpose of this repo is to unify different stemming components based on its language.


This package is distributed over the packagist service for composer. In order to use this package composer must be installed.

composer require nadar/stemming


Using the stemmer for your desired language:

include 'vendor/autoload.php';

$stemmed = \Nadar\Stemming\Stemm::stem('drinking', 'en');

echo $stemmed; // output: "drink"

If your provided language could not be found, the original word will be returned.

You can also stem a whole phrase:

echo \Nadar\Stemming\Stemm::stemPhrase('I am playing drums', 'en');


Certain words are on the ignore list, valid for all languages, see Stemm::$ignore. You can adjust that list with Stemm::$ignore = ['foo', 'bar'].

Librarys Used:

Testing and PR

In order to test the libray run:

./vendor/bin/phpunit tests

in order to psr2 fix your code run:

./vendor/bin/php-cs-fixer fix src/