コード例 #1
0
 public function pluralize($word, $count, $animate = false)
 {
     static $plu;
     if ($plu === null) {
         $plu = new RussianGeneralDeclension();
     }
     $ending = $count % 10;
     if ($count > 20 && $ending == 1 || $count == 1) {
         return $word;
     } else {
         if ($count > 20 && in_array($ending, range(2, 4)) || in_array($count, range(2, 4))) {
             return $plu->getForm($word, $animate, self::RODIT_2);
         } else {
             $forms = $plu->pluralizeAllDeclensions($word, $animate);
             return $forms[self::RODIT_2];
         }
     }
 }
コード例 #2
0
ファイル: functions.php プロジェクト: wapmorgan/morphos
function pluralize($word, $animate = false, $count)
{
    static $plu;
    if ($plu === null) {
        $plu = new RussianGeneralDeclension();
    }
    //$count = $count % 10;
    if (in_array($count, range(2, 4))) {
        return $plu->getForm($word, $animate, RussianGeneralDeclension::RODIT_2);
    } else {
        if ($count == 1) {
            return $word;
        } else {
            $forms = $plu->pluralizeAllDeclensions($word);
            return $forms[RussianGeneralDeclension::RODIT_2];
        }
    }
}