From 4c92cdcadaec797d32a6947f8031dd546a2a33da Mon Sep 17 00:00:00 2001 From: mark_story Date: Tue, 3 Sep 2013 12:50:02 -0400 Subject: [PATCH] Reorder inflection rules. Place rules for words like 'archives' and 'relatives' before words like 'knives'. Fixes #4040 --- lib/Cake/Test/Case/Utility/InflectorTest.php | 1 + lib/Cake/Utility/Inflector.php | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/Cake/Test/Case/Utility/InflectorTest.php b/lib/Cake/Test/Case/Utility/InflectorTest.php index 337830deb..76a937cda 100644 --- a/lib/Cake/Test/Case/Utility/InflectorTest.php +++ b/lib/Cake/Test/Case/Utility/InflectorTest.php @@ -118,6 +118,7 @@ class InflectorTest extends CakeTestCase { $this->assertEquals(Inflector::singularize('geese'), 'goose'); $this->assertEquals(Inflector::singularize('feet'), 'foot'); $this->assertEquals(Inflector::singularize('objectives'), 'objective'); + $this->assertEquals(Inflector::singularize('archives'), 'archive'); $this->assertEquals(Inflector::singularize(''), ''); } diff --git a/lib/Cake/Utility/Inflector.php b/lib/Cake/Utility/Inflector.php index 069eb2da9..622945b54 100644 --- a/lib/Cake/Utility/Inflector.php +++ b/lib/Cake/Utility/Inflector.php @@ -126,10 +126,10 @@ class Inflector { '/(s)eries$/i' => '\1\2eries', '/([^aeiouy]|qu)ies$/i' => '\1y', '/(tive)s$/i' => '\1', - '/([lre])ves$/i' => '\1f', - '/([^fo])ves$/i' => '\1fe', '/(hive)s$/i' => '\1', '/(drive)s$/i' => '\1', + '/([lre])ves$/i' => '\1f', + '/([^fo])ves$/i' => '\1fe', '/(^analy)ses$/i' => '\1sis', '/(analy|diagno|^ba|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$/i' => '\1\2sis', '/([ti])a$/i' => '\1um',