Permalink
Browse files

Fixing inflection of words ending in analysis. Fixes #619

  • Loading branch information...
1 parent 2fab47e commit 328c58635bdda19ff521a88564bc5cb6e9f07d84 @markstory markstory committed Apr 28, 2010
Showing with 5 additions and 1 deletion.
  1. +1 −1 cake/libs/inflector.php
  2. +4 −0 cake/tests/cases/libs/inflector.test.php
View
@@ -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',
@@ -116,6 +116,10 @@ function testInflectingSingulars() {
$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(''), '');
}

0 comments on commit 328c586

Please sign in to comment.