From 46c942f41ece95843b0c87cfb20660c124b63258 Mon Sep 17 00:00:00 2001 From: Tim Date: Sun, 9 Jan 2022 22:11:10 +0000 Subject: [PATCH] add rule for goose/geese --- pluralize.js | 7 ++++--- test.js | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/pluralize.js b/pluralize.js index 65dfcd5..9d280c1 100644 --- a/pluralize.js +++ b/pluralize.js @@ -313,7 +313,6 @@ ['yes', 'yeses'], ['foot', 'feet'], ['eave', 'eaves'], - ['goose', 'geese'], ['tooth', 'teeth'], ['quiz', 'quizzes'], ['human', 'humans'], @@ -354,6 +353,7 @@ [/(x|ch|ss|sh|zz)$/i, '$1es'], [/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i, '$1ices'], [/\b((?:tit)?m|l)(?:ice|ouse)$/i, '$1ice'], + [/\b((?:g)?g)(?:eese|oose)$/i, '$1eese'], [/(pe)(?:rson|ople)$/i, '$1ople'], [/(child)(?:ren)?$/i, '$1ren'], [/eaux$/i, '$0'], @@ -390,7 +390,8 @@ [/(pe)(rson|ople)$/i, '$1rson'], [/(child)ren$/i, '$1'], [/(eau)x?$/i, '$1'], - [/men$/i, 'man'] + [/men$/i, 'man'], + [/geese$/i, 'goose'] ].forEach(function (rule) { return pluralize.addSingularRule(rule[0], rule[1]); }); @@ -505,4 +506,4 @@ ].forEach(pluralize.addUncountableRule); return pluralize; -}); +}); \ No newline at end of file diff --git a/test.js b/test.js index fc84d37..ee3a119 100644 --- a/test.js +++ b/test.js @@ -238,6 +238,7 @@ var BASIC_TESTS = [ ['zero', 'zeros'], ['quest', 'quests'], ['goose', 'geese'], + ['canada goose', 'canada geese'], ['foot', 'feet'], ['ex', 'exes'], ['reflex', 'reflexes'], @@ -833,4 +834,4 @@ describe('pluralize', function () { expect(pluralize.singular('mornings')).to.equal('suck'); }); }); -}); +}); \ No newline at end of file