From 5661d52aceaa8162f40f335fa2faee7b88c4ec50 Mon Sep 17 00:00:00 2001 From: Peter Rehm Date: Sun, 29 May 2016 18:16:27 +0200 Subject: [PATCH] Fixed singular of committee --- .../Component/PropertyAccess/StringUtil.php | 15 +++++++++------ .../PropertyAccess/Tests/StringUtilTest.php | 1 + 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/Symfony/Component/PropertyAccess/StringUtil.php b/src/Symfony/Component/PropertyAccess/StringUtil.php index caa8c3d7e1..d4df676ec0 100644 --- a/src/Symfony/Component/PropertyAccess/StringUtil.php +++ b/src/Symfony/Component/PropertyAccess/StringUtil.php @@ -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 @@ -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'), @@ -214,11 +222,6 @@ class StringUtil } } - // 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; } diff --git a/src/Symfony/Component/PropertyAccess/Tests/StringUtilTest.php b/src/Symfony/Component/PropertyAccess/Tests/StringUtilTest.php index 983e355cb9..e6d0e5e908 100644 --- a/src/Symfony/Component/PropertyAccess/Tests/StringUtilTest.php +++ b/src/Symfony/Component/PropertyAccess/Tests/StringUtilTest.php @@ -53,6 +53,7 @@ class StringUtilTest extends \PHPUnit_Framework_TestCase 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'),