Merge pull request #3069 from wbkostan/master

Modifications to singulizer rules for Inflector.php. Supported with test cases
This commit is contained in:
Mark Story 2014-03-19 20:32:28 -04:00
commit 8c81cec904
2 changed files with 4 additions and 3 deletions

View file

@ -92,6 +92,8 @@ class InflectorTest extends CakeTestCase {
$this->assertEquals(Inflector::singularize('faxes'), 'fax');
$this->assertEquals(Inflector::singularize('waxes'), 'wax');
$this->assertEquals(Inflector::singularize('niches'), 'niche');
$this->assertEquals(Inflector::singularize('caves'), 'cave');
$this->assertEquals(Inflector::singularize('graves'), 'grave');
$this->assertEquals(Inflector::singularize('waves'), 'wave');
$this->assertEquals(Inflector::singularize('bureaus'), 'bureau');
$this->assertEquals(Inflector::singularize('genetic_analyses'), 'genetic_analysis');

View file

@ -117,7 +117,7 @@ class Inflector {
'/(alumn|bacill|cact|foc|fung|nucle|radi|stimul|syllab|termin|viri?)i$/i' => '\1us',
'/([ftw]ax)es/i' => '\1',
'/(cris|ax|test)es$/i' => '\1is',
'/(shoe|slave)s$/i' => '\1',
'/(shoe)s$/i' => '\1',
'/(o)es$/i' => '\1',
'/ouses$/' => 'ouse',
'/([^a])uses$/' => '\1us',
@ -130,7 +130,7 @@ class Inflector {
'/(hive)s$/i' => '\1',
'/(drive)s$/i' => '\1',
'/([le])ves$/i' => '\1f',
'/([^rfo])ves$/i' => '\1fe',
'/([^rfoa])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',
@ -147,7 +147,6 @@ class Inflector {
),
'irregular' => array(
'foes' => 'foe',
'waves' => 'wave',
)
);