Sastrawi\Stemmer\Stemmer::stem PHP Метод

stem() публичный Метод

Stem a text string to its common stem form.
public stem ( string $text ) : string
$text string the text string to stem, e.g : memberdayakan pembangunan
Результат string common stem form, e.g : daya bangun
    public function stem($text)
    {
        $normalizedText = Filter\TextNormalizer::normalizeText($text);
        $words = explode(' ', $normalizedText);
        $stems = array();
        foreach ($words as $word) {
            $stems[] = $this->stemWord($word);
        }
        return implode(' ', $stems);
    }