Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions src/Symfony/Component/Inflector/Inflector.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ final class Inflector
* @var array
*
* @see http://english-zone.com/spelling/plurals.html
* @see http://www.scribd.com/doc/3271143/List-of-100-Irregular-Plural-Nouns-in-English
*/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

private static $pluralMap = array(
// First entry: plural suffix, reversed
Expand Down Expand Up @@ -71,6 +70,15 @@ final class Inflector
// movies (movie)
array('seivom', 6, true, true, 'movie'),

// feet (foot)
array('teef', 4, true, true, 'foot'),

// geese (goose)
array('eseeg', 5, true, true, 'goose'),

// teeth (tooth)
array('hteet', 5, true, true, 'tooth'),

// news (news)
array('swen', 4, true, true, 'news'),

Expand Down Expand Up @@ -218,11 +226,6 @@ public static function singularize($plural)
}
}

// Convert teeth to tooth, feet to foot
if (false !== ($pos = strpos($plural, 'ee')) && strlen($plural) > 3 && 'feedback' !== $plural) {
return substr_replace($plural, 'oo', $pos, 2);
}

// Assume that plural and singular is identical
return $plural;
}
Expand Down
1 change: 1 addition & 0 deletions src/Symfony/Component/Inflector/Tests/InflectorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public function singularizeProvider()
array('children', 'child'),
array('circuses', array('circus', 'circuse', 'circusis')),
array('cliffs', 'cliff'),
array('committee', 'committee'),
array('crises', array('cris', 'crise', 'crisis')),
array('criteria', array('criterion', 'criterium')),
array('cups', 'cup'),
Expand Down