CoreFiles by mySites.guru
StemmerManager.php26 lines, 498 bytes, from Joomla_6.2.0-beta3-Beta-Full_Package.zip
Raw History Compare with 6.2.0-beta2
md5
92c9c688f7f735449facc8ac7ffc997c
sha1
74557e4c1146ab0095817fd58f217f33f8ef4243
sha256
5a2149233cbf83737d77e17d02cd0a4672867189b4c6c8fd8c4b76deef9deea4
<?php

namespace Wamania\Snowball;

class StemmerManager
{
    /** @var array */
    private $stemmers;

    public function __construct()
    {
        $this->stemmers = [];
    }

    /**
     * @throws NotFoundException
     */
    public function stem(string $word, string $isoCode): string
    {
        if (!isset($this->stemmers[$isoCode])) {
            $this->stemmers[$isoCode] = StemmerFactory::create($isoCode);
        }

        return $this->stemmers[$isoCode]->stem($word);
    }
}

The same content is in 289 releases, Joomla 4.0.0-beta to 6.3.0-alpha1. See them all, or every version of this file.