Skip to content

Commit

Permalink
Handle christmas <-> christmases (#83)
Browse files Browse the repository at this point in the history
  • Loading branch information
blakeembrey authored Nov 19, 2017
1 parent 9be3a26 commit de7b35e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pluralize.js
Original file line number Diff line number Diff line change
Expand Up @@ -330,9 +330,9 @@
[/[^\u0000-\u007F]$/i, '$0'],
[/([^aeiou]ese)$/i, '$1'],
[/(ax|test)is$/i, '$1es'],
[/(alias|[^aou]us|tlas|gas|ris)$/i, '$1es'],
[/(alias|[^aou]us|t[lm]as|gas|ris)$/i, '$1es'],
[/(e[mn]u)s?$/i, '$1s'],
[/([^l]ias|[aeiou]las|[emjzr]as|[iu]am)$/i, '$1'],
[/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i, '$1'],
[/(alumn|syllab|octop|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1i'],
[/(alumn|alg|vertebr)(?:a|ae)$/i, '$1ae'],
[/(seraph|cherub)(?:im)?$/i, '$1im'],
Expand Down Expand Up @@ -368,7 +368,7 @@
[/\b(mon|smil)ies$/i, '$1ey'],
[/(m|l)ice$/i, '$1ouse'],
[/(seraph|cherub)im$/i, '$1'],
[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|tlas|gas|(?:her|at|gr)o|ris)(?:es)?$/i, '$1'],
[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|ris)(?:es)?$/i, '$1'],
[/(analy|ba|diagno|parenthe|progno|synop|the|empha|cri)(?:sis|ses)$/i, '$1sis'],
[/(movie|twelve|abuse|e[mn]u)s$/i, '$1'],
[/(test)(?:is|es)$/i, '$1is'],
Expand Down
4 changes: 4 additions & 0 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,8 @@ var BASIC_TESTS = [
['sun', 'suns'],
['drink', 'drinks'],
['diploma', 'diplomas'],
['dilemma', 'dilemmas'],
['grandma', 'grandmas'],
['no', 'nos'],
['yes', 'yeses'],
['employ', 'employs'],
Expand Down Expand Up @@ -589,6 +591,8 @@ var BASIC_TESTS = [
['crispness', 'crispnesses'],
['racehorse', 'racehorses'],
['greatness', 'greatnesses'],
['christmas', 'christmases'],
['zymase', 'zymases'],
// Prototype inheritance.
['constructor', 'constructors'],
// Non-standard case.
Expand Down

0 comments on commit de7b35e

Please sign in to comment.