[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/libraries/vendor/wamania/php-stemmer/src/ -> StemmerManager.php (source)

   1  <?php
   2  
   3  namespace Wamania\Snowball;
   4  
   5  class StemmerManager
   6  {
   7      /** @var array */
   8      private $stemmers;
   9  
  10      public function __construct()
  11      {
  12          $this->stemmers = [];
  13      }
  14  
  15      /**
  16       * @throws NotFoundException
  17       */
  18      public function stem(string $word, string $isoCode): string
  19      {
  20          if (!isset($this->stemmers[$isoCode])) {
  21              $this->stemmers[$isoCode] = StemmerFactory::create($isoCode);
  22          }
  23  
  24          return $this->stemmers[$isoCode]->stem($word);
  25      }
  26  }


Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer