# Same singular as plural, can be extended via addl_same parameter
en_us_same = [
- "sheep" ,
- "fish" ,
- "salmon" ,
+ "aircraft" ,
"buffalo" ,
+ "deer" ,
+ "fish" ,
+ "goose" ,
+ "hovercraft" ,
"moose" ,
+ "salmon" ,
+ "sheep" ,
"shrimp" ,
+ "spacecraft" ,
"trout" ,
- "aircraft" ,
"watercraft" ,
- "hovercraft" ,
- "spacecraft" ,
- "deer" ,
- "goose" ,
] + addl_same
# Doesn't follow other rules, plural is always s, can be extended via addl_special_s
en_us_special_s = [
- "roof" ,
- "proof" ,
- "spoof" ,
- "piano" ,
"cello" ,
"hello" ,
"photo" ,
+ "piano" ,
+ "proof" ,
+ "roof" ,
+ "spoof" ,
"zero" ,
] + addl_special_s
@@ -180,16 +180,16 @@ Source code for talkgooder
list (
{
"child" : "children" ,
+ "criterion" : "criteria" ,
+ "die" : "dice" ,
+ "louse" : "lice" ,
+ "man" : "men" ,
+ "mouse" : "mice" ,
+ "ox" : "oxen" ,
"person" : "people" ,
+ "phenomenon" : "phenomena" ,
"tooth" : "teeth" ,
- "ox" : "oxen" ,
- "mouse" : "mice" ,
- "man" : "men" ,
"woman" : "women" ,
- "louse" : "lice" ,
- "die" : "dice" ,
- "phenomenon" : "phenomena" ,
- "criterion" : "criteria" ,
} . items ()
)
+ list ( addl_irregular . items ())
@@ -403,7 +403,7 @@ Source code for talkgooder
) -> str :
"""Given a quanity, determine if article should be ``is`` or ``are``.
- Given a quantity of nouns or noun-equivalents, determine whether the most article should be
+ Given a quantity of nouns or noun-equivalents, determine whether the article should be
``is`` or ``are``. For example, "there is one cat," and "there are two cats."
**Supported locales:**
@@ -440,6 +440,51 @@ Source code for talkgooder
+
+
[docs]
+
def wasWere (
+
number : int | float ,
+
language = "en-US" ,
+
) -> str :
+
"""Given a quanity, determine if article should be ``ws`` or ``were``.
+
+
Given a quantity of nouns or noun-equivalents, determine whether the article should be
+
``was`` or ``were``. For example, "there was one cat," and "there were two cats."
+
+
**Supported locales:**
+
+
* ``en-US``: American English
+
+
Args:
+
number (int | float):
+
Quantity of items.
+
language (str):
+
Which language rules to apply, specified by locale (default ``en-US``).
+
+
Returns:
+
String:
+
``was`` or ``were``, as appropriate.
+
+
Raises:
+
TypeError: number must be an int or float.
+
ValueError: language must be a supported locale.
+
"""
+
+
if not isinstance ( number , ( int , float )):
+
raise TypeError ( "Number must be an int or a float." )
+
+
if language . lower () == "en-us" :
+
# Anything other than integer 1 (even 1.0) uses "were"
+
if number == 1 and isinstance ( number , int ):
+
return "was"
+
else :
+
return "were"
+
+
else :
+
raise ValueError ( "Language must be a supported locale." )
+
+
+
[docs]
def aAn (
diff --git a/docs/_static/documentation_options.js b/docs/_static/documentation_options.js
index 30f1168..675092f 100644
--- a/docs/_static/documentation_options.js
+++ b/docs/_static/documentation_options.js
@@ -1,5 +1,5 @@
const DOCUMENTATION_OPTIONS = {
- VERSION: '0.0.post1.dev1+gdebd171',
+ VERSION: '1.0.4.post1.dev2+g818c923.d20241008',
LANGUAGE: 'en',
COLLAPSE_INDEX: false,
BUILDER: 'html',
diff --git a/docs/genindex.html b/docs/genindex.html
index 89011fb..f14a77b 100644
--- a/docs/genindex.html
+++ b/docs/genindex.html
@@ -3,7 +3,7 @@
-
Index — talkGooder 0.0.post1.dev1+gdebd171 documentation
+
Index — talkGooder 1.0.4.post1.dev2+g818c923.d20241008 documentation
@@ -14,7 +14,7 @@
-
+
@@ -36,7 +36,7 @@
talkGooder
- 0.0.post1.dev1+gdebd171
+ 1.0.4.post1.dev2+g818c923.d20241008
A
@@ -145,6 +146,14 @@
T
+
W
+
+
diff --git a/docs/index.html b/docs/index.html
index 02732f6..fbc936e 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -4,7 +4,7 @@
- talkGooder documentation — talkGooder 0.0.post1.dev1+gdebd171 documentation
+ talkGooder documentation — talkGooder 1.0.4.post1.dev2+g818c923.d20241008 documentation
@@ -15,7 +15,7 @@
-
+
@@ -37,7 +37,7 @@
talkGooder
- 0.0.post1.dev1+gdebd171
+ 1.0.4.post1.dev2+g818c923.d20241008