Skip to content

Commit

Permalink
Fixing singularization of "curves"
Browse files Browse the repository at this point in the history
  • Loading branch information
ADmad committed Jul 7, 2011
1 parent af12a17 commit 1bccc77
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions lib/Cake/Test/Case/Utility/InflectorTest.php
Expand Up @@ -106,6 +106,7 @@ public function testInflectingSingulars() {
$this->assertEqual(Inflector::singularize('diagnoses'), 'diagnosis');
$this->assertEqual(Inflector::singularize('bases'), 'basis');
$this->assertEqual(Inflector::singularize('analyses'), 'analysis');
$this->assertEqual(Inflector::singularize('curves'), 'curve');

$this->assertEqual(Inflector::singularize(''), '');
}
Expand Down
7 changes: 4 additions & 3 deletions lib/Cake/Utility/Inflector.php
Expand Up @@ -143,7 +143,8 @@ class Inflector {
'.*[nrlm]ese', '.*deer', '.*fish', '.*measles', '.*ois', '.*pox', '.*sheep', '.*ss'
),
'irregular' => array(
'waves' => 'wave'
'waves' => 'wave',
'curves' => 'curve'
)
);

Expand Down Expand Up @@ -397,14 +398,14 @@ public static function singularize($word) {

if (!isset(self::$_singular['merged']['uninflected'])) {
self::$_singular['merged']['uninflected'] = array_merge(
self::$_singular['uninflected'],
self::$_singular['uninflected'],
self::$_uninflected
);
}

if (!isset(self::$_singular['merged']['irregular'])) {
self::$_singular['merged']['irregular'] = array_merge(
self::$_singular['irregular'],
self::$_singular['irregular'],
array_flip(self::$_plural['irregular'])
);
}
Expand Down

0 comments on commit 1bccc77

Please sign in to comment.