Skip to content

Commit

Permalink
Fix inflection rules for curves.
Browse files Browse the repository at this point in the history
Remove curve from the uninflected list and update rules so it, wolves,
and lives are still properly handled.

Fixes #2148
  • Loading branch information
markstory committed Oct 17, 2013
1 parent 935a51c commit 1ae470a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 2 additions & 0 deletions lib/Cake/Test/Case/Utility/InflectorTest.php
Expand Up @@ -122,6 +122,7 @@ public function testInflectingSingulars() {
$this->assertEquals(Inflector::singularize('briefs'), 'brief');
$this->assertEquals(Inflector::singularize('quotas'), 'quota');
$this->assertEquals(Inflector::singularize('curves'), 'curve');
$this->assertEquals(Inflector::singularize('body_curves'), 'body_curve');
$this->assertEquals(Inflector::singularize(''), '');
}

Expand Down Expand Up @@ -185,6 +186,7 @@ public function testInflectingPlurals() {
$this->assertEquals(Inflector::pluralize('brief'), 'briefs');
$this->assertEquals(Inflector::pluralize('quota'), 'quotas');
$this->assertEquals(Inflector::pluralize('curve'), 'curves');
$this->assertEquals(Inflector::pluralize('body_curve'), 'body_curves');
$this->assertEquals(Inflector::pluralize(''), '');
}

Expand Down
5 changes: 2 additions & 3 deletions lib/Cake/Utility/Inflector.php
Expand Up @@ -129,8 +129,8 @@ class Inflector {
'/(tive)s$/i' => '\1',
'/(hive)s$/i' => '\1',
'/(drive)s$/i' => '\1',
'/([lre])ves$/i' => '\1f',
'/([^fo])ves$/i' => '\1fe',
'/([le])ves$/i' => '\1f',
'/([^rfo])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',
Expand All @@ -148,7 +148,6 @@ class Inflector {
'irregular' => array(
'foes' => 'foe',
'waves' => 'wave',
'curves' => 'curve'
)
);

Expand Down

0 comments on commit 1ae470a

Please sign in to comment.