Skip to content

Commit

Permalink
Adding waves -> wave as irregular singularization rule. Fixes #47.
Browse files Browse the repository at this point in the history
  • Loading branch information
jperras committed Aug 23, 2009
1 parent 47d9181 commit 6f8f4c5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cake/libs/inflector.php
Expand Up @@ -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',
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions cake/tests/cases/libs/inflector.test.php
Expand Up @@ -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(''), '');
}
/**
Expand Down Expand Up @@ -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(''), '');
}
/**
Expand Down

0 comments on commit 6f8f4c5

Please sign in to comment.