Permalink
Browse files

Fixing inflection of words ending in causes. Fixes #736

  • Loading branch information...
1 parent 7865334 commit 23d4bafd39fe6334511b357e63ade319a924631b @markstory markstory committed May 22, 2010
Showing with 3 additions and 1 deletion.
  1. +1 −1 cake/libs/inflector.php
  2. +2 −0 cake/tests/cases/libs/inflector.test.php
View
@@ -121,7 +121,7 @@ class Inflector {
'/(shoe|slave)s$/i' => '\1',
'/(o)es$/i' => '\1',
'/ouses$/' => 'ouse',
- '/uses$/' => 'us',
+ '/([^a])uses$/' => '\1us',
'/([m|l])ice$/i' => '\1ouse',
'/(x|ch|ss|sh)es$/i' => '\1',
'/(m)ovies$/i' => '\1\2ovie',
@@ -119,6 +119,8 @@ function testInflectingSingulars() {
$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('Causes'), 'Cause');
+ $this->assertEqual(Inflector::singularize('colossuses'), 'colossus');
$this->assertEqual(Inflector::singularize(''), '');
}

0 comments on commit 23d4baf

Please sign in to comment.