@@ 36-38 (lines=3) @@ | ||
33 | return false; |
|
34 | } |
|
35 | ||
36 | if (in_array(S::slice($name, -1), ['а', 'я'], true)) { |
|
37 | return true; |
|
38 | } |
|
39 | ||
40 | if ($gender == static::MALE) { |
|
41 | // Несклоняемые фамилии (Фоминых, Седых / Стецко, Писаренко) |
|
@@ 42-43 (lines=2) @@ | ||
39 | ||
40 | if ($gender == static::MALE) { |
|
41 | // Несклоняемые фамилии (Фоминых, Седых / Стецко, Писаренко) |
|
42 | if (in_array(S::slice($name, -2), ['ых', 'ко'], true)) |
|
43 | return false; |
|
44 | ||
45 | // Несклоняемые, образованные из родительного падежа личного или прозвищного имени главы семьи |
|
46 | // суффиксы: ово, аго |
|
@@ 47-48 (lines=2) @@ | ||
44 | ||
45 | // Несклоняемые, образованные из родительного падежа личного или прозвищного имени главы семьи |
|
46 | // суффиксы: ово, аго |
|
47 | if (in_array(S::slice($name, -3), ['ово', 'аго'], true)) |
|
48 | return false; |
|
49 | ||
50 | // Типичные суффикс мужских фамилий |
|
51 | if (in_array(S::slice($name, -2), ['ов', 'ев', 'ин', 'ын', 'ий', 'ой'], true)) { |
|
@@ 65-70 (lines=6) @@ | ||
62 | return true; |
|
63 | } |
|
64 | ||
65 | } else { |
|
66 | // Типичные суффиксы женских фамилий |
|
67 | if (in_array(S::slice($name, -2), ['ва', 'на', 'ая'], true)) { |
|
68 | return true; |
|
69 | } |
|
70 | } |
|
71 | ||
72 | return false; |
|
73 | } |
@@ 37-39 (lines=3) @@ | ||
34 | public static function isMutable($name, $gender = null) |
|
35 | { |
|
36 | $name = S::lower($name); |
|
37 | if (in_array(S::slice($name, -2), ['ич', 'на'], true)) { |
|
38 | return true; |
|
39 | } |
|
40 | ||
41 | // it's foreign middle name, inflect it as a first name |
|
42 | return FirstNamesInflection::isMutable($name, $gender); |
@@ 101-103 (lines=3) @@ | ||
98 | return true; |
|
99 | } elseif (S::slice($name, -1) == 'й') { |
|
100 | return true; |
|
101 | } else if (in_array(S::slice($name, -2), ['ло', 'ко'], true)) { |
|
102 | return true; |
|
103 | } |
|
104 | } else if ($gender === static::FEMALE) { |
|
105 | // soft consonant |
|
106 | if (S::lower(S::slice($name, -1)) == 'ь' && static::isConsonant(S::slice($name, -2, -1))) { |
@@ 281-282 (lines=2) @@ | ||
278 | public static function in($word) |
|
279 | { |
|
280 | $normalized = trim(S::lower($word)); |
|
281 | if (in_array(S::slice($normalized, 0, 1), ['в', 'ф'], true)) |
|
282 | return 'во '.$word; |
|
283 | return 'в '.$word; |
|
284 | } |
|
285 |