From 3aa25065939ea3784a364d974c3f9ee2299223d4 Mon Sep 17 00:00:00 2001 From: RA Date: Thu, 23 Jul 2015 19:19:51 +0300 Subject: [PATCH] =?UTF-8?q?fix=20=D0=BE=D0=BF=D1=80=D0=B5=D0=B4=D0=B5?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=D0=B8=D0=B5=20=D1=84=D0=B0=D0=BC=D0=B8=D0=BB?= =?UTF-8?q?=D0=B8=D0=B8=20=D0=BD=D0=B0=20-=D1=83=D0=B0=20=D0=BD=D0=B5=20?= =?UTF-8?q?=D1=81=D0=BA=D0=BB=D0=BE=D0=BD=D1=8F=D0=B5=D0=BC;=20=D0=BD?= =?UTF-8?q?=D0=B5=20=D1=81=D0=BA=D0=BB=D0=BE=D0=BD=D1=8F=D0=B5=D0=BC=20'?= =?UTF-8?q?=D0=B2=D0=B0=D0=BD',=20'=D0=B4=D0=B5';=20=D0=BF=D1=80=D0=B0?= =?UTF-8?q?=D0=B2=D0=B8=D0=BB=D0=B0=20=D0=B4=D0=BB=D1=8F=20=D1=81=D0=BB?= =?UTF-8?q?=D0=BE=D0=B2=20'=D1=81=D1=82=D0=B0=D1=80=D1=88=D0=B8=D0=B9',=20?= =?UTF-8?q?'=D0=BC=D0=BB=D0=B0=D0=B4=D1=88=D0=B8=D0=B9';=20=D0=B6=D0=B5?= =?UTF-8?q?=D0=BD=D1=81=D0=BA=D0=B8=D0=B5=20=D0=B8=D0=BC=D0=B5=D0=BD=D0=B0?= =?UTF-8?q?=20=D0=BD=D0=B0=20-=D0=B2=D0=B8=D1=8F;=20=D0=B8=D1=81=D0=BA?= =?UTF-8?q?=D0=BB=D1=8E=D1=87=D0=B5=D0=BD=D0=B8=D1=8F=20'=D0=90=D0=BD?= =?UTF-8?q?=D1=80=D0=B8',=20'=D0=9F=D0=B8=D1=82=D0=B5=D1=80',=20'=D0=9F?= =?UTF-8?q?=D0=B0=D1=83=D0=BB=D1=8C',=20'=D0=9C=D0=B0=D0=BA=D1=81',=20'?= =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81',=20'=D0=A4=D1=80=D0=B0=D0=BD?= =?UTF-8?q?=D1=86'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Library/NCLNameCaseRu.php | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/Library/NCLNameCaseRu.php b/Library/NCLNameCaseRu.php index edcaa7e..4df7584 100644 --- a/Library/NCLNameCaseRu.php +++ b/Library/NCLNameCaseRu.php @@ -52,7 +52,7 @@ class NCLNameCaseRu extends NCLNameCaseCore * Окончания имен/фамилий, который не склоняются * @var array */ - private $ih = array('их', 'ых', 'ко'); + private $ih = array('их', 'ых', 'ко', 'уа');//Бенуа, Франсуа /** * Список окончаний характерных для фамилий * По шаблону {letter}* где * любой символ кроме тех, что в {exclude} @@ -140,10 +140,16 @@ class NCLNameCaseRu extends NCLNameCaseCore $this->Rule(202); return true; } + elseif ($this->inNames($this->workingWord, array("ван", 'де'))) + { + $this->Rule(203); + $this->makeResultTheSame(); + return true; + } else { $this->wordForms($this->workingWord, array('а', 'у', 'а', 'ом', 'е')); - $this->Rule(203); + $this->Rule(204); return true; } } @@ -473,6 +479,11 @@ class NCLNameCaseRu extends NCLNameCaseCore */ protected function manFirstName() { + if ($this->inNames($this->workingWord, array('Старший', 'Младший'))) + { + $this->wordForms($this->workingWord, array('его', 'ему', 'его', 'им', 'ем'), 2); + return true; + } return $this->RulesChain('man', array(1, 2, 3)); } @@ -592,7 +603,7 @@ class NCLNameCaseRu extends NCLNameCaseCore $woman+=0.15; } - if ($this->in($this->Last(3), array('лия', 'ния', 'сия', 'дра', 'лла', 'кла', 'опа'))) + if ($this->in($this->Last(3), array('лия', 'ния', 'сия', 'дра', 'лла', 'кла', 'опа', 'вия'))) //Ольвия { $woman+=0.5; } @@ -602,7 +613,7 @@ class NCLNameCaseRu extends NCLNameCaseCore $woman+=0.5; } - if ($this->inNames($this->workingWord, 'Вова')) + if ($this->inNames($this->workingWord, array('Вова', 'Анри', 'Питер', 'Пауль'))) { $man += 10; } @@ -714,7 +725,7 @@ class NCLNameCaseRu extends NCLNameCaseCore } /** - * Не бывает имет с такими предпоследними буквами + * Не бывает имен с такими предпоследними буквами */ if ($this->in($this->Last(2, 1), 'жчщъэю')) { @@ -771,7 +782,8 @@ class NCLNameCaseRu extends NCLNameCaseCore } //Исключения - if ($this->inNames($namepart, array('Лев', 'Яков', 'Вова', 'Маша', 'Ольга', 'Еремей', 'Исак', 'Исаак', 'Ева', 'Ирина', 'Элькин', 'Мерлин'))) + if ($this->inNames($namepart, array('Лев', 'Яков', 'Вова', 'Маша', 'Ольга', 'Еремей', + 'Исак', 'Исаак', 'Ева', 'Ирина', 'Элькин', 'Мерлин', 'Макс', 'Алекс', 'Франц', 'Питер', 'Пауль'))) { $first+=10; }