Skip to content

Commit

Permalink
[String][EnglishInflector] Fix words ending in 'le', e.g., articles
Browse files Browse the repository at this point in the history
  • Loading branch information
aleho committed Aug 1, 2024
1 parent 909cec9 commit 8be1d48
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Inflector/EnglishInflector.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ final class EnglishInflector implements InflectorInterface
// statuses (status)
['sesutats', 8, true, true, 'status'],

// article (articles), ancle (ancles)
['sel', 3, true, true, 'le'],

// analyses (analysis), ellipses (ellipsis), fungi (fungus),
// neuroses (neurosis), theses (thesis), emphases (emphasis),
// oases (oasis), crises (crisis), houses (house), bases (base),
Expand Down
4 changes: 4 additions & 0 deletions Tests/Inflector/EnglishInflectorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@ public static function singularizeProvider()
['alumnae', 'alumna'],
['alumni', 'alumnus'],
['analyses', ['analys', 'analyse', 'analysis']],
['ankles', 'ankle'],
['antennae', 'antenna'],
['antennas', 'antenna'],
['appendices', ['appendex', 'appendix', 'appendice']],
['arches', ['arch', 'arche']],
['articles', 'article'],
['atlases', ['atlas', 'atlase', 'atlasis']],
['axes', ['ax', 'axe', 'axis']],
['babies', 'baby'],
Expand Down Expand Up @@ -189,9 +191,11 @@ public static function pluralizeProvider()
['album', 'albums'],
['alumnus', 'alumni'],
['analysis', 'analyses'],
['ankle', 'ankles'],
['antenna', 'antennas'], // antennae
['appendix', ['appendicies', 'appendixes']],
['arch', 'arches'],
['article', 'articles'],
['atlas', 'atlases'],
['axe', 'axes'],
['axis', 'axes'],
Expand Down

0 comments on commit 8be1d48

Please sign in to comment.