From 2a764816ab8b794c7db763adbaa60b6cb6d3ee92 Mon Sep 17 00:00:00 2001 From: Tim Date: Sun, 9 Jan 2022 20:12:44 +0000 Subject: [PATCH] add rule for goose/geese --- pluralize.js | 5 +++-- test.js | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pluralize.js b/pluralize.js index 65dfcd5..a8d62b3 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]); }); diff --git a/test.js b/test.js index fc84d37..e89f15d 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'],