Code Duplication    Length = 2-5 lines in 5 locations

src/Russian/FirstNamesInflection.php 1 location

@@ 428-430 (lines=3) @@
425
        if (in_array($last3, array('лия', 'ния', 'сия', 'дра', 'лла', 'кла', 'опа'))) {
426
            $woman += 0.5;
427
        }
428
        if (in_array(S::slice($name, -4), array('льда', 'фира', 'нина', 'лита', 'алья'))) {
429
            $woman += 0.5;
430
        }
431
432
        return $man == $woman ? null
433
            : ($man > $woman ? self::MALE : self::FEMALE);

src/Russian/LastNamesInflection.php 1 location

@@ 46-48 (lines=3) @@
43
                return false;
44
45
            // Типичные суффикс мужских фамилий
46
            if (in_array(S::slice($name, -2), array('ов', 'ев', 'ин', 'ын', 'ий', 'ой'))) {
47
                return true;
48
            }
49
50
            // Согласная на конце
51
            if (self::isConsonant(S::slice($name, -1))) {

src/Russian/NounDeclension.php 1 location

@@ 320-322 (lines=3) @@
317
        // слова с бегающей гласной в корне
318
        if (in_array($word, self::$masculineWithSoftAndRunAwayVowels)) {
319
            $prefix = S::slice($word, 0, -3).S::slice($word, -2, -1);
320
        } elseif (in_array($last, ['о', 'е', 'ё', 'ь', 'й'])) {
321
            $prefix = S::slice($word, 0, -1);
322
        }
323
        // уменьшительные формы слов (котенок) и слова с суффиксом ок
324
        elseif (S::slice($word, -2) == 'ок' && S::length($word) > 3) {
325
            $prefix = S::slice($word, 0, -2).'к';

src/Russian/RussianLanguage.php 2 locations

@@ 113-117 (lines=5) @@
110
111
    public static function choosePrepositionByFirstLetter($word, $prepositionWithVowel, $preposition)
112
    {
113
        if (in_array(S::upper(S::slice($word, 0, 1)), array('А', 'О', 'И', 'У', 'Э'))) {
114
            return $prepositionWithVowel;
115
        } else {
116
            return $preposition;
117
        }
118
    }
119
120
    public static function chooseVowelAfterConsonant($last, $soft_last, $after_soft, $after_hard)
@@ 183-184 (lines=2) @@
180
		if (static::isVowel(S::slice($normalized, 0, 1)) && !in_array(S::slice($normalized, 0, 1), ['е', 'ё', 'ю', 'я']))
181
			return 'об '.$word;
182
183
		if (in_array(S::slice($normalized, 0, 3), ['все', 'всё', 'всю', 'что', 'мне']))
184
			return 'обо '.$word;
185
186
		return 'о '.$word;
187
	}