Skip to content

Commit 5661d52

Browse files
peterrehmfabpot
authored andcommitted
Fixed singular of committee
1 parent a81b6ce commit 5661d52

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

src/Symfony/Component/PropertyAccess/StringUtil.php

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ class StringUtil
2424
* @var array
2525
*
2626
* @see http://english-zone.com/spelling/plurals.html
27-
* @see http://www.scribd.com/doc/3271143/List-of-100-Irregular-Plural-Nouns-in-English
2827
*/
2928
private static $pluralMap = array(
3029
// First entry: plural suffix, reversed
@@ -69,6 +68,15 @@ class StringUtil
6968
// movies (movie)
7069
array('seivom', 6, true, true, 'movie'),
7170

71+
// feet (foot)
72+
array('teef', 4, true, true, 'foot'),
73+
74+
// geese (goose)
75+
array('eseeg', 5, true, true, 'goose'),
76+
77+
// teeth (tooth)
78+
array('hteet', 5, true, true, 'tooth'),
79+
7280
// news (news)
7381
array('swen', 4, true, true, 'news'),
7482

@@ -214,11 +222,6 @@ public static function singularify($plural)
214222
}
215223
}
216224

217-
// Convert teeth to tooth, feet to foot
218-
if (false !== ($pos = strpos($plural, 'ee')) && strlen($plural) > 3 && 'feedback' !== $plural) {
219-
return substr_replace($plural, 'oo', $pos, 2);
220-
}
221-
222225
// Assume that plural and singular is identical
223226
return $plural;
224227
}

src/Symfony/Component/PropertyAccess/Tests/StringUtilTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ public function singularifyProvider()
5353
array('children', 'child'),
5454
array('circuses', array('circus', 'circuse', 'circusis')),
5555
array('cliffs', 'cliff'),
56+
array('committee', 'committee'),
5657
array('crises', array('cris', 'crise', 'crisis')),
5758
array('criteria', array('criterion', 'criterium')),
5859
array('cups', 'cup'),

0 commit comments

Comments
 (0)