morphos\RussianGeneralDeclension::declinateSecondDeclension PHP Method

declinateSecondDeclension() public method

public declinateSecondDeclension ( $word )
    public function declinateSecondDeclension($word)
    {
        $word = lower($word);
        $prefix = slice($word, 0, -1);
        $last = slice($word, -1);
        $soft_last = $this->checkLastConsonantSoftness($word);
        $forms = array(RussianCases::IMENIT_1 => $word);
        // RODIT_2
        $forms[RussianCases::RODIT_2] = $this->chooseVowelAfterConsonant($last, $soft_last, $prefix . 'и', $prefix . 'ы');
        // DAT_3
        $forms[RussianCases::DAT_3] = $this->getPredCaseOf12Declensions($word, $last, $prefix);
        // VINIT_4
        $forms[RussianCases::VINIT_4] = $this->chooseVowelAfterConsonant($last, $soft_last, $prefix . 'ю', $prefix . 'у');
        // TVORIT_5
        if ($last == 'ь') {
            $forms[RussianCases::TVORIT_5] = $prefix . 'ой';
        } else {
            $forms[RussianCases::TVORIT_5] = $this->chooseVowelAfterConsonant($last, $soft_last, $prefix . 'ей', $prefix . 'ой');
        }
        // 	if ($last == 'й' || ($this->isConsonant($last) && !$this->isHissingConsonant($last)) || $this->checkLastConsonantSoftness($word))
        // 	$forms[RussianCases::TVORIT_5] = $prefix.'ей';
        // else
        // 	$forms[RussianCases::TVORIT_5] = $prefix.'ой'; # http://morpher.ru/Russian/Spelling.aspx#sibilant
        // PREDLOJ_6 the same as DAT_3
        $forms[RussianCases::PREDLOJ_6] = $forms[RussianCases::DAT_3];
        return $forms;
    }