From a34683dc2306212e5be7095baef2ac38043c993d Mon Sep 17 00:00:00 2001 From: DONGSHIH TENG Date: Fri, 3 Mar 2017 11:13:19 +0900 Subject: [PATCH] Consider ending word's ASCII --- pluralize.js | 2 +- test.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pluralize.js b/pluralize.js index 46dd615..d0a41a1 100644 --- a/pluralize.js +++ b/pluralize.js @@ -301,7 +301,7 @@ */ [ [/s?$/i, 's'], - [/[^\u0000-\u007F]+/i, '$0'], + [/[^\u0000-\u007F]$/i, '$0'], [/([^aeiou]ese)$/i, '$1'], [/(ax|test)is$/i, '$1es'], [/(alias|[^aou]us|tlas|gas|ris)$/i, '$1es'], diff --git a/test.js b/test.js index a2d7c27..19396f2 100644 --- a/test.js +++ b/test.js @@ -585,7 +585,8 @@ var BASIC_TESTS = [ ['日本語', '日本語'], ['한국', '한국'], ['中文', '中文'], - ['اللغة العربية', 'اللغة العربية'] + ['اللغة العربية', 'اللغة العربية'], + ['四 chicken', '四 chickens'] ]; /**