Skip to content

Commit

Permalink
fix #102
Browse files Browse the repository at this point in the history
  • Loading branch information
wapmorgan committed Apr 22, 2021
1 parent 6ac6666 commit e81756a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Russian/LastNamesInflection.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,14 +210,14 @@ public static function getCases($name, $gender = null)
$prefix = S::name(S::slice($name, 0, -1));
return [
static::IMENIT => S::name($name),
static::RODIT => $prefix.(static::isDeafConsonant(S::slice($name, -2, -1)) || S::slice($name, -2)
== 'га' ? 'и' : 'ы'),
static::RODIT => $prefix.((static::isDeafConsonant(S::slice($name, -2, -1)) && S::slice($name, -2, -1) !== 'п')
|| S::slice($name, -2) === 'га' ? 'и' : 'ы'),
static::DAT => $prefix.'е',
static::VINIT => $prefix.'у',
static::TVORIT => $prefix.'ой',
static::PREDLOJ => $prefix.'е'
];
} elseif (static::isConsonant(S::slice($name, -1)) && S::slice($name, -2) != 'ых') {
} elseif (static::isConsonant(S::slice($name, -1)) && S::slice($name, -2) !== 'ых') {
$prefix = S::name($name);
return [
static::IMENIT => S::name($name),
Expand Down
1 change: 1 addition & 0 deletions tests/Russian/LastNamesInflectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public function lastNamesProvider()
['Стальной', NamesInflection::MALE, 'Стального', 'Стальному', 'Стального', 'Стальным', 'Стальном'],
['Жареный', NamesInflection::MALE, 'Жареного', 'Жареному', 'Жареного', 'Жареным', 'Жареном'],
['Прожога', NamesInflection::MALE, 'Прожоги', 'Прожоге', 'Прожогу', 'Прожогой', 'Прожоге'],
['Мазепа', NamesInflection::MALE, 'Мазепы', 'Мазепе', 'Мазепу', 'Мазепой', 'Мазепе'],

['Смирнова', NamesInflection::FEMALE, 'Смирновой', 'Смирновой', 'Смирнову', 'Смирновой', 'Смирновой'],
['Кромская', NamesInflection::FEMALE, 'Кромской', 'Кромской', 'Кромскую', 'Кромской', 'Кромской'],
Expand Down

0 comments on commit e81756a

Please sign in to comment.