Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more irregular words #25

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 24 additions & 6 deletions lib/inflections/en.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@
->plural('/^(ox)$/i', '\1en')
->plural('/^(oxen)$/i', '\1')
->plural('/(quiz)$/i', '\1zes')
->plural('/^is$/i', 'are')
->plural('/^was$/i', 'were')
->plural('/^has$/i', 'have')

->singular('/s$/i', '')
->singular('/(ss)$/i', '\1')
Expand Down Expand Up @@ -66,19 +69,34 @@
->singular('/(matr)ices$/i', '\1ix')
->singular('/(quiz)zes$/i', '\1')
->singular('/(database)s$/i', '\1')
->singular('/^are$/i', 'is')
->singular('/^were$/i', 'was')
->singular('/^have$/i', 'has')

->irregular('appendix', 'appendices')
->irregular('cactus', 'cacti')
->irregular('child', 'children')
->irregular('criterion', 'criteria')
->irregular('curriculum', 'curricula')
->irregular('foot', 'feet')
->irregular('genus', 'genera')
->irregular('goose', 'geese')
->irregular('leaf', 'leaves')
->irregular('loaf', 'loaves')
->irregular('man', 'men')
->irregular('move', 'moves')
->irregular('nucleus', 'nuclei')
->irregular('octopus', 'octopuses')

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

->irregular('virus', 'viruses')
->irregular('person', 'people')
->irregular('man', 'men')
->irregular('child', 'children')
->irregular('phenomenon', 'phenomena')
->irregular('radius', 'radii')
->irregular('sex', 'sexes')
->irregular('move', 'moves')
->irregular('stimulus', 'stimuli')
->irregular('syllabus', 'syllabi')
->irregular('thief', 'thieves')
->irregular('tooth', 'teeth')
->irregular('virus', 'viruses')
->irregular('zombie', 'zombies')
->irregular('goose', 'geese')
->irregular('genus', 'genera')

// http://easenglish.net/Files/Grammar/uncountable%20words.pdf
->uncountable(explode(' ', 'advice aircraft art baggage butter clothing coal cotton deer equipment experience feedback fish flour food furniture gas homework impatience information jeans knowledge leather love luggage management money moose music news oil patience police polish progress research rice salmon sand series sheep silk sms soap spam species staff sugar swine talent toothpaste traffic travel vinegar weather wood wool work'));
Expand Down
65 changes: 44 additions & 21 deletions tests/Inflections/en.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"process" => "processes",
"address" => "addresses",
"case" => "cases",
"release" => "releases",
"stack" => "stacks",
"wish" => "wishes",
"fish" => "fish",
Expand All @@ -31,19 +32,19 @@
"wife" => "wives",
"safe" => "saves",
"half" => "halves",
"scarf" => "scarves",
"wharf" => "wharves",

"move" => "moves",

"salesperson" => "salespeople",
"person" => "people",

"spokesman" => "spokesmen",
"man" => "men",
"woman" => "women",

"basis" => "bases",
"diagnosis" => "diagnoses",
"diagnosis_a" => "diagnosis_as",
"ellipsis" => "ellipses",
"hypothesis" => "hypotheses",
"oasis" => "oases",
"paralysis" => "paralyses",
"synthesis" => "syntheses",

"datum" => "data",
"medium" => "media",
Expand Down Expand Up @@ -90,7 +91,6 @@

"louse" => "lice",
"house" => "houses",
"octopus" => "octopuses",
"virus" => "viruses",
"alias" => "aliases",
"portfolio" => "portfolios",
Expand Down Expand Up @@ -120,22 +120,45 @@
"slice" => "slices",
"police" => "police",

# "f" or "fe" => "ves"
"calf" => "calves",
"half" => "halves",
"knife" => "knives",
"leaf" => "leaves",
"loaf" => "loaves",
# "f" or "fe" => "ves"
"calf" => "calves",
"half" => "halves",
"knife" => "knives",
"leaf" => "leaves",
"life" => "lives",
"loaf" => "loaves",

# irregulars

'person' => 'people',
'man' => 'men',
'child' => 'children',
'sex' => 'sexes',
'move' => 'moves',
'zombie' => 'zombies',
'genus' => 'genera',
"appendix" => "appendices",
"cactus" => "cacti",
"child" => "children",
"criterion" => "criteria",
"curriculum" => "curricula",
"foot" => "feet",
"genus" => "genera",
"goose" => "geese",
"is" => "are",
"leaf" => "leaves",
"loaf" => "loaves",
"man" => "men",
"move" => "moves",
"nucleus" => "nuclei",
"octopus" => "octopuses",
"person" => "people",
"phenomenon" => "phenomena",
"radius" => "radii",
"salesperson" => "salespeople",
"sex" => "sexes",
"spokesman" => "spokesmen",
"stimulus" => "stimuli",
"syllabus" => "syllabi",
"thief" => "thieves",
"tooth" => "teeth",
"virus" => "viruses",
"was" => "were",
"woman" => "women",
"zombie" => "zombies",

# uncountable

Expand Down