Permalink
Browse files

Adding waves -> wave as irregular singularization rule. Fixes #47.

  • Loading branch information...
1 parent 47d9181 commit 6f8f4c5a05b7fa26844c77f8f67c1fbd31e33c25 @jperras jperras committed Aug 23, 2009
Showing with 7 additions and 2 deletions.
  1. +5 −2 cake/libs/inflector.php
  2. +2 −0 cake/tests/cases/libs/inflector.test.php
View
@@ -318,7 +318,8 @@ function __initSingularRules() {
'nexus', 'Niasese', 'Pekingese', 'Piedmontese', 'pincers', 'Pistoiese', 'pliers', 'Portuguese', 'proceedings',
'rabies', 'rice', 'rhinoceros', 'salmon', 'Sarawakese', 'scissors', 'sea[- ]bass', 'series', 'Shavese', 'shears',
'siemens', 'species', 'swine', 'testes', 'trousers', 'trout', 'tuna', 'Vermontese', 'Wenchowese',
- 'whiting', 'wildebeest', 'Yengeese');
+ 'whiting', 'wildebeest', 'Yengeese'
+ );
$coreIrregularSingular = array(
'atlases' => 'atlas',
@@ -349,7 +350,9 @@ function __initSingularRules() {
'soliloquies' => 'soliloquy',
'testes' => 'testis',
'trilbys' => 'trilby',
- 'turfs' => 'turf');
+ 'turfs' => 'turf',
+ 'waves' => 'wave'
+ );
$singularRules = Set::pushDiff($this->__singularRules, $coreSingularRules);
$uninflected = Set::pushDiff($this->__uninflectedSingular, $coreUninflectedSingular);
@@ -108,6 +108,7 @@ function testInflectingSingulars() {
$this->assertEqual(Inflector::singularize('taxes'), 'tax');
$this->assertEqual(Inflector::singularize('faxes'), 'fax');
$this->assertEqual(Inflector::singularize('waxes'), 'wax');
+ $this->assertEqual(Inflector::singularize('waves'), 'wave');
$this->assertEqual(Inflector::singularize(''), '');
}
/**
@@ -151,6 +152,7 @@ function testInflectingPlurals() {
$this->assertEqual(Inflector::pluralize('people'), 'people');
$this->assertEqual(Inflector::pluralize('glove'), 'gloves');
$this->assertEqual(Inflector::pluralize('crisis'), 'crises');
+ $this->assertEqual(Inflector::pluralize('wave'), 'waves');
$this->assertEqual(Inflector::pluralize(''), '');
}
/**

0 comments on commit 6f8f4c5

Please sign in to comment.