morphos\RussianGeneralDeclension::getDeclension PHP 메소드

getDeclension() 공개 메소드

public getDeclension ( $word )
    public function getDeclension($word)
    {
        $word = lower($word);
        $last = slice($word, -1);
        if ($this->isConsonant($last) || in_array($last, ['о', 'е', 'ё']) || $last == 'ь' && $this->isConsonant(slice($word, -2, -1)) && !$this->isHissingConsonant(slice($word, -2, -1))) {
            return 1;
        } else {
            if (in_array($last, ['а', 'я']) && slice($word, -2) != 'мя') {
                return 2;
            } else {
                return 3;
            }
        }
    }