From 37c64e7c074bf74930ff2165f41eb5bcafe4950c Mon Sep 17 00:00:00 2001 From: Reza Date: Fri, 17 May 2024 15:22:49 +0200 Subject: [PATCH 1/3] Fix wrong pluralization of "stadium" --- lib/Doctrine/Inflector/Rules/English/Inflectible.php | 1 + .../Tests/Inflector/Rules/English/EnglishFunctionalTest.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Doctrine/Inflector/Rules/English/Inflectible.php b/lib/Doctrine/Inflector/Rules/English/Inflectible.php index 8bf02a2..fb682d7 100644 --- a/lib/Doctrine/Inflector/Rules/English/Inflectible.php +++ b/lib/Doctrine/Inflector/Rules/English/Inflectible.php @@ -180,5 +180,6 @@ public static function getIrregular(): iterable yield new Substitution(new Word('oasis'), new Word('oases')); yield new Substitution(new Word('valve'), new Word('valves')); yield new Substitution(new Word('zombie'), new Word('zombies')); + yield new Substitution(new Word('stadium'), new Word('stadiums')); } } diff --git a/tests/Doctrine/Tests/Inflector/Rules/English/EnglishFunctionalTest.php b/tests/Doctrine/Tests/Inflector/Rules/English/EnglishFunctionalTest.php index b74ecf4..bb37813 100644 --- a/tests/Doctrine/Tests/Inflector/Rules/English/EnglishFunctionalTest.php +++ b/tests/Doctrine/Tests/Inflector/Rules/English/EnglishFunctionalTest.php @@ -310,7 +310,7 @@ public function dataSampleWords(): array ['spouse', 'spouses'], ['spy', 'spies'], ['stack', 'stacks'], - ['stadium', 'stadia'], + ['stadium', 'stadiums'], ['staff', 'staff'], ['status', 'statuses'], ['status_code', 'status_codes'], From ae6b967a0724a97c81b6a34b53c51f0d5d0f7d02 Mon Sep 17 00:00:00 2001 From: Reza Date: Fri, 17 May 2024 15:24:07 +0200 Subject: [PATCH 2/3] Remove duplicated "medium" from English irregular list --- lib/Doctrine/Inflector/Rules/English/Inflectible.php | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/Doctrine/Inflector/Rules/English/Inflectible.php b/lib/Doctrine/Inflector/Rules/English/Inflectible.php index fb682d7..1ff9b5d 100644 --- a/lib/Doctrine/Inflector/Rules/English/Inflectible.php +++ b/lib/Doctrine/Inflector/Rules/English/Inflectible.php @@ -173,7 +173,6 @@ public static function getIrregular(): iterable yield new Substitution(new Word('foe'), new Word('foes')); yield new Substitution(new Word('grave'), new Word('graves')); yield new Substitution(new Word('hoax'), new Word('hoaxes')); - yield new Substitution(new Word('medium'), new Word('media')); yield new Substitution(new Word('neurosis'), new Word('neuroses')); yield new Substitution(new Word('save'), new Word('saves')); yield new Substitution(new Word('wave'), new Word('waves')); From e4e859c26b7fc3e23c77a5ab091982d2f2c3663f Mon Sep 17 00:00:00 2001 From: Reza Rabbani Date: Thu, 23 May 2024 19:26:55 +0200 Subject: [PATCH 3/3] Sort list of English irregulars --- .../Inflector/Rules/English/Inflectible.php | 33 +++++++++---------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/lib/Doctrine/Inflector/Rules/English/Inflectible.php b/lib/Doctrine/Inflector/Rules/English/Inflectible.php index 1ff9b5d..a311d74 100644 --- a/lib/Doctrine/Inflector/Rules/English/Inflectible.php +++ b/lib/Doctrine/Inflector/Rules/English/Inflectible.php @@ -92,28 +92,33 @@ public static function getPlural(): iterable /** @return Substitution[] */ public static function getIrregular(): iterable { + yield new Substitution(new Word('abuse'), new Word('abuses')); yield new Substitution(new Word('atlas'), new Word('atlases')); + yield new Substitution(new Word('avalanche'), new Word('avalanches')); yield new Substitution(new Word('axis'), new Word('axes')); yield new Substitution(new Word('axe'), new Word('axes')); yield new Substitution(new Word('beef'), new Word('beefs')); yield new Substitution(new Word('blouse'), new Word('blouses')); yield new Substitution(new Word('brother'), new Word('brothers')); + yield new Substitution(new Word('brownie'), new Word('brownies')); + yield new Substitution(new Word('cache'), new Word('caches')); yield new Substitution(new Word('cafe'), new Word('cafes')); + yield new Substitution(new Word('canvas'), new Word('canvases')); yield new Substitution(new Word('cave'), new Word('caves')); yield new Substitution(new Word('chateau'), new Word('chateaux')); - yield new Substitution(new Word('niveau'), new Word('niveaux')); yield new Substitution(new Word('child'), new Word('children')); - yield new Substitution(new Word('canvas'), new Word('canvases')); yield new Substitution(new Word('cookie'), new Word('cookies')); - yield new Substitution(new Word('brownie'), new Word('brownies')); yield new Substitution(new Word('corpus'), new Word('corpuses')); yield new Substitution(new Word('cow'), new Word('cows')); yield new Substitution(new Word('criterion'), new Word('criteria')); yield new Substitution(new Word('curriculum'), new Word('curricula')); + yield new Substitution(new Word('curve'), new Word('curves')); yield new Substitution(new Word('demo'), new Word('demos')); yield new Substitution(new Word('domino'), new Word('dominoes')); yield new Substitution(new Word('echo'), new Word('echoes')); + yield new Substitution(new Word('emphasis'), new Word('emphases')); yield new Substitution(new Word('epoch'), new Word('epochs')); + yield new Substitution(new Word('foe'), new Word('foes')); yield new Substitution(new Word('foot'), new Word('feet')); yield new Substitution(new Word('fungus'), new Word('fungi')); yield new Substitution(new Word('ganglion'), new Word('ganglions')); @@ -122,7 +127,9 @@ public static function getIrregular(): iterable yield new Substitution(new Word('genus'), new Word('genera')); yield new Substitution(new Word('goose'), new Word('geese')); yield new Substitution(new Word('graffito'), new Word('graffiti')); + yield new Substitution(new Word('grave'), new Word('graves')); yield new Substitution(new Word('hippopotamus'), new Word('hippopotami')); + yield new Substitution(new Word('hoax'), new Word('hoaxes')); yield new Substitution(new Word('hoof'), new Word('hoofs')); yield new Substitution(new Word('human'), new Word('humans')); yield new Substitution(new Word('iris'), new Word('irises')); @@ -138,9 +145,12 @@ public static function getIrregular(): iterable yield new Substitution(new Word('motto'), new Word('mottoes')); yield new Substitution(new Word('move'), new Word('moves')); yield new Substitution(new Word('mythos'), new Word('mythoi')); + yield new Substitution(new Word('neurosis'), new Word('neuroses')); yield new Substitution(new Word('niche'), new Word('niches')); + yield new Substitution(new Word('niveau'), new Word('niveaux')); yield new Substitution(new Word('nucleus'), new Word('nuclei')); yield new Substitution(new Word('numen'), new Word('numina')); + yield new Substitution(new Word('oasis'), new Word('oases')); yield new Substitution(new Word('occiput'), new Word('occiputs')); yield new Substitution(new Word('octopus'), new Word('octopuses')); yield new Substitution(new Word('opus'), new Word('opuses')); @@ -151,10 +161,12 @@ public static function getIrregular(): iterable yield new Substitution(new Word('plateau'), new Word('plateaux')); yield new Substitution(new Word('runner-up'), new Word('runners-up')); yield new Substitution(new Word('safe'), new Word('safes')); + yield new Substitution(new Word('save'), new Word('saves')); yield new Substitution(new Word('sex'), new Word('sexes')); yield new Substitution(new Word('sieve'), new Word('sieves')); yield new Substitution(new Word('soliloquy'), new Word('soliloquies')); yield new Substitution(new Word('son-in-law'), new Word('sons-in-law')); + yield new Substitution(new Word('stadium'), new Word('stadiums')); yield new Substitution(new Word('syllabus'), new Word('syllabi')); yield new Substitution(new Word('testis'), new Word('testes')); yield new Substitution(new Word('thief'), new Word('thieves')); @@ -163,22 +175,9 @@ public static function getIrregular(): iterable yield new Substitution(new Word('trilby'), new Word('trilbys')); yield new Substitution(new Word('turf'), new Word('turfs')); yield new Substitution(new Word('valve'), new Word('valves')); + yield new Substitution(new Word('valve'), new Word('valves')); // Duplicate yield new Substitution(new Word('volcano'), new Word('volcanoes')); - yield new Substitution(new Word('abuse'), new Word('abuses')); - yield new Substitution(new Word('avalanche'), new Word('avalanches')); - yield new Substitution(new Word('cache'), new Word('caches')); - yield new Substitution(new Word('criterion'), new Word('criteria')); - yield new Substitution(new Word('curve'), new Word('curves')); - yield new Substitution(new Word('emphasis'), new Word('emphases')); - yield new Substitution(new Word('foe'), new Word('foes')); - yield new Substitution(new Word('grave'), new Word('graves')); - yield new Substitution(new Word('hoax'), new Word('hoaxes')); - yield new Substitution(new Word('neurosis'), new Word('neuroses')); - yield new Substitution(new Word('save'), new Word('saves')); yield new Substitution(new Word('wave'), new Word('waves')); - yield new Substitution(new Word('oasis'), new Word('oases')); - yield new Substitution(new Word('valve'), new Word('valves')); yield new Substitution(new Word('zombie'), new Word('zombies')); - yield new Substitution(new Word('stadium'), new Word('stadiums')); } }