Skip to content

Commit

Permalink
Ensures that Tights, and Shorts and Blouse are single/pluralised prop…
Browse files Browse the repository at this point in the history
…erly (#202)

* Ensures that Tights, and Shorts are never singularised in English, ensures that Blouses is never singularised to Blice

* Add Unit tests for Blouse, Shorts, Tights
  • Loading branch information
powellblyth committed Sep 7, 2022
1 parent 4e544a4 commit ade2b3b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/Doctrine/Inflector/Rules/English/Inflectible.php
Expand Up @@ -56,6 +56,8 @@ public static function getSingular(): iterable
yield new Transformation(new Pattern('(f)eet$'), '\1oot');
yield new Transformation(new Pattern('(n)ews$'), '\1\2ews');
yield new Transformation(new Pattern('eaus$'), 'eau');
yield new Transformation(new Pattern('^tights$'), 'tights');
yield new Transformation(new Pattern('^shorts$'), 'shorts');
yield new Transformation(new Pattern('s$'), '');
}

Expand Down Expand Up @@ -99,6 +101,7 @@ public static function getIrregular(): iterable
yield new Substitution(new Word('atlas'), new Word('atlases'));
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('cafe'), new Word('cafes'));
yield new Substitution(new Word('chateau'), new Word('chateaux'));
Expand Down
Expand Up @@ -47,6 +47,7 @@ public function dataSampleWords(): array
['baggage', 'baggage'],
['basis', 'bases'],
['bison', 'bison'],
['blouse', 'blouses'],
['borghese', 'borghese'],
['box', 'boxes'],
['bream', 'bream'],
Expand Down Expand Up @@ -352,6 +353,7 @@ public function dataSampleWords(): array
['shelf', 'shelves'],
['shoe', 'shoes'],
['shoe', 'shoes'],
['shorts', 'shorts'],
['siemens', 'siemens'],
['silk', 'silk'],
['sku', 'skus'],
Expand Down Expand Up @@ -393,6 +395,7 @@ public function dataSampleWords(): array
['testis', 'testes'],
['thesis', 'theses'],
['Thief', 'Thieves'],
['tights', 'tights'],
['tomato', 'tomatoes'],
['tomato', 'tomatoes'],
['tooth', 'teeth'],
Expand Down

0 comments on commit ade2b3b

Please sign in to comment.