Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixing inflection of words ending in causes. Fixes #736

  • Loading branch information...
commit 23d4bafd39fe6334511b357e63ade319a924631b 1 parent 7865334
@markstory markstory authored
View
2  cake/libs/inflector.php
@@ -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',
View
2  cake/tests/cases/libs/inflector.test.php
@@ -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(''), '');
}
Please sign in to comment.
Something went wrong with that request. Please try again.