Fixing singularization of "curves"

This commit is contained in:
ADmad 2011-07-07 23:08:03 +05:30
parent af12a17b81
commit 1bccc7713d
2 changed files with 5 additions and 3 deletions

View file

@ -106,6 +106,7 @@ class InflectorTest extends CakeTestCase {
$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(''), '');
}

View file

@ -143,7 +143,8 @@ class Inflector {
'.*[nrlm]ese', '.*deer', '.*fish', '.*measles', '.*ois', '.*pox', '.*sheep', '.*ss'
),
'irregular' => array(
'waves' => 'wave'
'waves' => 'wave',
'curves' => 'curve'
)
);
@ -397,14 +398,14 @@ class Inflector {
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'])
);
}