Fixing inflection of words ending in analysis. Fixes #619

This commit is contained in:
Mark Story 2010-04-27 23:03:19 -04:00
parent 2fab47e740
commit 328c58635b
2 changed files with 5 additions and 1 deletions

View file

@ -133,7 +133,7 @@ class Inflector {
'/(drive)s$/i' => '\1',
'/([^fo])ves$/i' => '\1fe',
'/(^analy)ses$/i' => '\1sis',
'/((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$/i' => '\1\2sis',
'/(analy|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$/i' => '\1\2sis',
'/([ti])a$/i' => '\1um',
'/(p)eople$/i' => '\1\2erson',
'/(m)en$/i' => '\1an',

View file

@ -116,6 +116,10 @@ class InflectorTest extends CakeTestCase {
$this->assertEqual(Inflector::singularize('niches'), 'niche');
$this->assertEqual(Inflector::singularize('waves'), 'wave');
$this->assertEqual(Inflector::singularize('bureaus'), 'bureau');
$this->assertEqual(Inflector::singularize('genetic_analyses'), 'genetic_analysis');
$this->assertEqual(Inflector::singularize('doctor_diagnoses'), 'doctor_diagnosis');
$this->assertEqual(Inflector::singularize('parantheses'), 'paranthesis');
$this->assertEqual(Inflector::singularize(''), '');
}