Esempio n. 1
0
 static function create(phpMorphy_MorphyInterface $morphy)
 {
     $locale = strtolower($morphy->getLocale());
     if (!isset(self::$included[$locale])) {
         $class = "phpMorphy_GrammemsProvider_{$locale}";
         if (!class_exists($class)) {
             self::$included[$locale] = call_user_func(array($class, 'instance'), $morphy);
         } else {
             self::$included[$locale] = new phpMorphy_GrammemsProvider_Empty($morphy);
         }
     }
     return self::$included[$locale];
 }
Esempio n. 2
0
 /**
  * @param phpMorphy_MorphyInterface $morphy
  * @return phpMorphy_Dict_Source_Mutable
  */
 protected function createMutableSource(phpMorphy_MorphyInterface $morphy)
 {
     $source = new phpMorphy_Dict_Source_Mutable();
     $source->setLanguage($morphy->getLocale());
     return $source;
 }