SnowballStemmer
in package
implements
StemmerInterface
Snowball stemmer for Catalan, Danish, Dutch, English, Finnish, French, German, Italian, Norwegian, Portuguese, Romanian, Russian, Spanish and Swedish, provided by wamania/php-stemmer.
Requires composer require wamania/php-stemmer. Words of other languages are returned unchanged.
Table of Contents
Interfaces
- StemmerInterface
- Reduces a single word to its stem.
Properties
- $stemmerManager : StemmerManager|null
Methods
- stem() : string
Properties
$stemmerManager
private
StemmerManager|null
$stemmerManager
= null
Methods
stem()
public
stem(string $word, string $locale) : string
Parameters
- $word : string
-
Already lowercased and trimmed, accents are kept (they are stripped after stemming)
- $locale : string
-
The language of the word as locale ID or language tag, e.g. "de", "de_CH" or "de-CH". Return the word unchanged for languages the stemmer does not support.