Permalink
Browse files

Adding additional plural inflection rule.

  • Loading branch information...
jperras committed Jul 30, 2009
1 parent 6fd0bfc commit bc28dd834e01c426eb9dc40c0488e48b1de89fbb
Showing with 2 additions and 1 deletion.
  1. +1 −1 cake/libs/inflector.php
  2. +1 −0 cake/tests/cases/libs/inflector.test.php
View
@@ -124,7 +124,7 @@ class Inflector extends Object {
'/(alumn|bacill|cact|foc|fung|nucle|radi|stimul|syllab|termin|viri?)i$/i' => '\1us',
'/([ftw]ax)es/' => '\1',
'/(cris|ax|test)es$/i' => '\1is',
- '/(shoe)s$/i' => '\1',
+ '/(shoe|slave)s$/i' => '\1',
'/(o)es$/i' => '\1',
'/ouses$/' => 'ouse',
'/uses$/' => 'us',
@@ -99,6 +99,7 @@ function testInflectingSingulars() {
$this->assertEqual(Inflector::singularize('lives'), 'life');
$this->assertEqual(Inflector::singularize('knives'), 'knife');
$this->assertEqual(Inflector::singularize('wolves'), 'wolf');
+ $this->assertEqual(Inflector::singularize('slaves'), 'slave');
$this->assertEqual(Inflector::singularize('shelves'), 'shelf');
$this->assertEqual(Inflector::singularize('taxis'), 'taxi');
$this->assertEqual(Inflector::singularize('taxes'), 'tax');

0 comments on commit bc28dd8

Please sign in to comment.