Fixing inflection of words ending in causes. Fixes #736

This commit is contained in:
mark_story 2010-05-21 23:49:49 -04:00
parent 78653347b2
commit 23d4bafd39
2 changed files with 3 additions and 1 deletions

View file

@ -121,7 +121,7 @@ class Inflector {
'/(shoe|slave)s$/i' => '\1', '/(shoe|slave)s$/i' => '\1',
'/(o)es$/i' => '\1', '/(o)es$/i' => '\1',
'/ouses$/' => 'ouse', '/ouses$/' => 'ouse',
'/uses$/' => 'us', '/([^a])uses$/' => '\1us',
'/([m|l])ice$/i' => '\1ouse', '/([m|l])ice$/i' => '\1ouse',
'/(x|ch|ss|sh)es$/i' => '\1', '/(x|ch|ss|sh)es$/i' => '\1',
'/(m)ovies$/i' => '\1\2ovie', '/(m)ovies$/i' => '\1\2ovie',

View file

@ -119,6 +119,8 @@ class InflectorTest extends CakeTestCase {
$this->assertEqual(Inflector::singularize('genetic_analyses'), 'genetic_analysis'); $this->assertEqual(Inflector::singularize('genetic_analyses'), 'genetic_analysis');
$this->assertEqual(Inflector::singularize('doctor_diagnoses'), 'doctor_diagnosis'); $this->assertEqual(Inflector::singularize('doctor_diagnoses'), 'doctor_diagnosis');
$this->assertEqual(Inflector::singularize('parantheses'), 'paranthesis'); $this->assertEqual(Inflector::singularize('parantheses'), 'paranthesis');
$this->assertEqual(Inflector::singularize('Causes'), 'Cause');
$this->assertEqual(Inflector::singularize('colossuses'), 'colossus');
$this->assertEqual(Inflector::singularize(''), ''); $this->assertEqual(Inflector::singularize(''), '');
} }