Skip to content

Fixed singular of committee #18911

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
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/PropertyAccess/StringUtil.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ class StringUtil
* @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
*/
private static $pluralMap = array(
// First entry: plural suffix, reversed
Expand Down Expand Up @@ -69,6 +68,15 @@ class StringUtil
// 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 @@ -211,11 +219,6 @@ public static function singularify($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
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public function singularifyProvider()
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