From 9fb015a80819dcd52f793c7a2ada6b542faf2cbb Mon Sep 17 00:00:00 2001 From: Pranithan Thamcharoenporn Date: Mon, 26 Aug 2024 11:21:49 +0700 Subject: [PATCH 1/5] re-order the irregular list --- inflection/__init__.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/inflection/__init__.py b/inflection/__init__.py index ffac5ce..62e89d9 100644 --- a/inflection/__init__.py +++ b/inflection/__init__.py @@ -419,11 +419,11 @@ def underscore(word: str) -> str: return word.lower() -_irregular('person', 'people') -_irregular('man', 'men') -_irregular('human', 'humans') +_irregular('cow', 'kine') _irregular('child', 'children') -_irregular('sex', 'sexes') +_irregular('human', 'humans') +_irregular('man', 'men') _irregular('move', 'moves') -_irregular('cow', 'kine') +_irregular('person', 'people') +_irregular('sex', 'sexes') _irregular('zombie', 'zombies') From 0fc35de0461a7edf2ff1c3ce142c1b5f8761c84f Mon Sep 17 00:00:00 2001 From: Pranithan Thamcharoenporn Date: Mon, 26 Aug 2024 11:23:16 +0700 Subject: [PATCH 2/5] add goose/geese and foot/feet word pair into irregular list --- inflection/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/inflection/__init__.py b/inflection/__init__.py index 62e89d9..fbaa810 100644 --- a/inflection/__init__.py +++ b/inflection/__init__.py @@ -421,6 +421,8 @@ def underscore(word: str) -> str: _irregular('cow', 'kine') _irregular('child', 'children') +_irregular('foot', 'feet') +_irregular('goose', 'geese') _irregular('human', 'humans') _irregular('man', 'men') _irregular('move', 'moves') From abb1b92d8b860658f80f95b16a750a96d3d8613b Mon Sep 17 00:00:00 2001 From: Pranithan Thamcharoenporn Date: Mon, 26 Aug 2024 11:49:50 +0700 Subject: [PATCH 3/5] correct the order of man and human word pair because it is dependent --- inflection/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/inflection/__init__.py b/inflection/__init__.py index fbaa810..61bff1d 100644 --- a/inflection/__init__.py +++ b/inflection/__init__.py @@ -423,9 +423,11 @@ def underscore(word: str) -> str: _irregular('child', 'children') _irregular('foot', 'feet') _irregular('goose', 'geese') -_irregular('human', 'humans') -_irregular('man', 'men') _irregular('move', 'moves') _irregular('person', 'people') _irregular('sex', 'sexes') _irregular('zombie', 'zombies') + +# more specific rules at the end +_irregular('man', 'men') +_irregular('human', 'humans') \ No newline at end of file From 010544cc0f66a224d53708f064aeed64f45805c9 Mon Sep 17 00:00:00 2001 From: Pranithan Thamcharoenporn Date: Mon, 26 Aug 2024 11:50:09 +0700 Subject: [PATCH 4/5] add test case of goose and foot --- test_inflection.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test_inflection.py b/test_inflection.py index f1e64a3..1555325 100644 --- a/test_inflection.py +++ b/test_inflection.py @@ -112,7 +112,9 @@ ("cow", "kine"), ("database", "databases"), - ("human", "humans") + ("human", "humans"), + ("goose", "geese"), + ("foot", "feet") ) CAMEL_TO_UNDERSCORE: TestParameters = ( From 9750389796c1d62f32a4573d67e8e98d13dd7a81 Mon Sep 17 00:00:00 2001 From: Pranithan Thamcharoenporn Date: Mon, 26 Aug 2024 11:50:28 +0700 Subject: [PATCH 5/5] add word diabetes to uncountable nouns --- inflection/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/inflection/__init__.py b/inflection/__init__.py index 61bff1d..4395b33 100644 --- a/inflection/__init__.py +++ b/inflection/__init__.py @@ -88,7 +88,9 @@ 'rice', 'series', 'sheep', - 'species'} + 'species', + 'diabetes' +} def _irregular(singular: str, plural: str) -> None: