diff --git a/docs/.buildinfo b/docs/.buildinfo index 10c980b..757db9b 100644 --- a/docs/.buildinfo +++ b/docs/.buildinfo @@ -1,4 +1,4 @@ # Sphinx build info version 1 # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. -config: d3775153b19b07eed8a6918b6fa9de0f +config: f8f30efefcc47efe55b0328d4ecab3f3 tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/docs/_modules/index.html b/docs/_modules/index.html index 4faca4d..0d7235e 100644 --- a/docs/_modules/index.html +++ b/docs/_modules/index.html @@ -3,7 +3,7 @@ - Overview: module code — talkGooder 0.0.post1.dev1+gdebd171 documentation + Overview: module code — 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
diff --git a/docs/_modules/talkgooder.html b/docs/_modules/talkgooder.html index a83e826..b4a1325 100644 --- a/docs/_modules/talkgooder.html +++ b/docs/_modules/talkgooder.html @@ -3,7 +3,7 @@ - talkgooder — talkGooder 0.0.post1.dev1+gdebd171 documentation + talkgooder — talkGooder 1.0.4.post1.dev2+g818c923 documentation @@ -14,7 +14,7 @@ - + @@ -36,7 +36,7 @@ talkGooder
- 0.0.post1.dev1+gdebd171 + 1.0.4.post1.dev2+g818c923
@@ -148,30 +148,30 @@

Source code for talkgooder

 
         # 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
@@ -81,6 +81,7 @@

Index

| N | P | T + | W

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
@@ -57,6 +57,7 @@
  • num2word()
  • plural()
  • possessive()
  • +
  • wasWere()
  • @@ -161,7 +162,7 @@

    Functions talkgooder.isAre(number: int | float, language='en-US') str[source]

    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:

      @@ -301,6 +302,38 @@

      Functions +
      +talkgooder.wasWere(number: int | float, language='en-US') str[source]
      +

      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

      • +
      +
      +
      Parameters:
      +
        +
      • number (int | float) – Quantity of items.

      • +
      • language (str) – Which language rules to apply, specified by locale (default en-US).

      • +
      +
      +
      Returns:
      +

      was or were, as appropriate.

      +
      +
      Return type:
      +

      String

      +
      +
      Raises:
      +
        +
      • TypeError – number must be an int or float.

      • +
      • ValueError – language must be a supported locale.

      • +
      +
      +
      +
      +
      diff --git a/docs/objects.inv b/docs/objects.inv index 3684ef0..b8c99c7 100644 --- a/docs/objects.inv +++ b/docs/objects.inv @@ -1,5 +1,6 @@ # Sphinx inventory version 2 # Project: talkGooder -# Version: 0.0.post1.dev1+gdebd171 +# Version: 1.0.4.post1.dev2+g818c923.d20241008 # The remainder of this file is compressed using zlib. -xڍ0ED\ce\>R {pv2ˠP{Ylvt,J?MvlŔ%3Mp \ No newline at end of file +xڍ0F>Mt-G6&`b\%y{) +ƄnZ&R5}(jT-Pb?pr酻t5F5Ni-i&qe S?1sŵ/(`7@Sґ?/U>5(-Ȱ?׷=àY{[ Z.\Bf%7^s[ \ No newline at end of file diff --git a/docs/py-modindex.html b/docs/py-modindex.html index 810cecc..004ef69 100644 --- a/docs/py-modindex.html +++ b/docs/py-modindex.html @@ -3,7 +3,7 @@ - Python Module Index — talkGooder 0.0.post1.dev1+gdebd171 documentation + Python Module Index — talkGooder 1.0.4.post1.dev2+g818c923.d20241008 documentation @@ -14,7 +14,7 @@ - + @@ -43,7 +43,7 @@ talkGooder
      - 0.0.post1.dev1+gdebd171 + 1.0.4.post1.dev2+g818c923.d20241008
      diff --git a/docs/search.html b/docs/search.html index bd90805..a3f79b9 100644 --- a/docs/search.html +++ b/docs/search.html @@ -3,7 +3,7 @@ - Search — talkGooder 0.0.post1.dev1+gdebd171 documentation + Search — talkGooder 1.0.4.post1.dev2+g818c923.d20241008 documentation @@ -15,7 +15,7 @@ - + @@ -39,7 +39,7 @@ talkGooder
      - 0.0.post1.dev1+gdebd171 + 1.0.4.post1.dev2+g818c923.d20241008
      diff --git a/docs/searchindex.js b/docs/searchindex.js index 956cc6f..56a09a1 100644 --- a/docs/searchindex.js +++ b/docs/searchindex.js @@ -1 +1 @@ -Search.setIndex({"alltitles": {"Functions": [[0, "functions"]], "Talk Gooder": [[0, "talk-gooder"]], "talkGooder documentation": [[0, null]]}, "docnames": ["index"], "envversion": {"sphinx": 62, "sphinx.domains.c": 3, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 9, "sphinx.domains.index": 1, "sphinx.domains.javascript": 3, "sphinx.domains.math": 2, "sphinx.domains.python": 4, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx.ext.viewcode": 1}, "filenames": ["index.rst"], "indexentries": {"aan() (in module talkgooder)": [[0, "talkgooder.aAn", false]], "isare() (in module talkgooder)": [[0, "talkgooder.isAre", false]], "module": [[0, "module-talkgooder", false]], "num2word() (in module talkgooder)": [[0, "talkgooder.num2word", false]], "plural() (in module talkgooder)": [[0, "talkgooder.plural", false]], "possessive() (in module talkgooder)": [[0, "talkgooder.possessive", false]], "talkgooder": [[0, "module-talkgooder", false]]}, "objects": {"": [[0, 0, 0, "-", "talkgooder"]], "talkgooder": [[0, 1, 1, "", "aAn"], [0, 1, 1, "", "isAre"], [0, 1, 1, "", "num2word"], [0, 1, 1, "", "plural"], [0, 1, 1, "", "possessive"]]}, "objnames": {"0": ["py", "module", "Python module"], "1": ["py", "function", "Python function"]}, "objtypes": {"0": "py:module", "1": "py:function"}, "terms": {"": 0, "0": 0, "1": 0, "2": 0, "9": 0, "A": 0, "For": 0, "It": 0, "The": 0, "There": 0, "aan": 0, "about": 0, "accommod": 0, "addit": 0, "addl_irregular": 0, "addl_sam": 0, "addl_special_": 0, "alwai": 0, "american": 0, "an": 0, "apa": 0, "apostroph": 0, "appli": 0, "applic": 0, "appropri": 0, "ar": 0, "articl": 0, "attempt": 0, "becaus": 0, "begin": 0, "between": 0, "brianwarn": 0, "can": 0, "caps_mod": 0, "case": 0, "cat": 0, "com": 0, "complic": 0, "consist": 0, "consumpt": 0, "contribut": 0, "convert": 0, "corner": 0, "current": 0, "default": 0, "depend": 0, "determin": 0, "dict": 0, "digit": 0, "don": 0, "e": 0, "els": 0, "en": 0, "end": 0, "english": 0, "equival": 0, "everyth": 0, "exampl": 0, "except": 0, "expand": 0, "extens": 0, "float": 0, "forc": 0, "form": 0, "format": 0, "g": 0, "gener": 0, "github": 0, "given": 0, "grammar": 0, "handl": 0, "hard": 0, "hello": 0, "human": 0, "i": 0, "infer": 0, "int": 0, "integ": 0, "intend": 0, "irregular": 0, "isar": 0, "item": 0, "its": 0, "know": 0, "languag": 0, "like": 0, "list": 0, "local": 0, "lower": 0, "made": 0, "manual": 0, "mice": 0, "most": 0, "mous": 0, "much": 0, "must": 0, "noun": 0, "num2word": 0, "number": 0, "odd": 0, "one": 0, "other": 0, "out": 0, "pair": 0, "paramet": 0, "peopl": 0, "per": 0, "person": 0, "piano": 0, "plural": 0, "possess": 0, "provid": 0, "punctuat": 0, "quaniti": 0, "quantiti": 0, "rais": 0, "reason": 0, "relat": 0, "repres": 0, "return": 0, "rule": 0, "same": 0, "should": 0, "singular": 0, "situat": 0, "smooth": 0, "so": 0, "soft": 0, "sourc": 0, "specif": 0, "specifi": 0, "str": 0, "string": 0, "style": 0, "suffix": 0, "suppli": 0, "support": 0, "t": 0, "text": 0, "thi": 0, "try": 0, "two": 0, "type": 0, "typeerror": 0, "u": 0, "upon": 0, "upper": 0, "us": 0, "user": 0, "v": 0, "valueerror": 0, "vowel": 0, "welcom": 0, "when": 0, "where": 0, "whether": 0, "which": 0, "word": 0, "written": 0, "you": 0}, "titles": ["talkGooder documentation"], "titleterms": {"document": 0, "function": 0, "gooder": 0, "talk": 0, "talkgood": 0}}) \ No newline at end of file +Search.setIndex({"alltitles": {"Functions": [[0, "functions"]], "Talk Gooder": [[0, "talk-gooder"]], "talkGooder documentation": [[0, null]]}, "docnames": ["index"], "envversion": {"sphinx": 62, "sphinx.domains.c": 3, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 9, "sphinx.domains.index": 1, "sphinx.domains.javascript": 3, "sphinx.domains.math": 2, "sphinx.domains.python": 4, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx.ext.viewcode": 1}, "filenames": ["index.rst"], "indexentries": {"aan() (in module talkgooder)": [[0, "talkgooder.aAn", false]], "isare() (in module talkgooder)": [[0, "talkgooder.isAre", false]], "module": [[0, "module-talkgooder", false]], "num2word() (in module talkgooder)": [[0, "talkgooder.num2word", false]], "plural() (in module talkgooder)": [[0, "talkgooder.plural", false]], "possessive() (in module talkgooder)": [[0, "talkgooder.possessive", false]], "talkgooder": [[0, "module-talkgooder", false]], "waswere() (in module talkgooder)": [[0, "talkgooder.wasWere", false]]}, "objects": {"": [[0, 0, 0, "-", "talkgooder"]], "talkgooder": [[0, 1, 1, "", "aAn"], [0, 1, 1, "", "isAre"], [0, 1, 1, "", "num2word"], [0, 1, 1, "", "plural"], [0, 1, 1, "", "possessive"], [0, 1, 1, "", "wasWere"]]}, "objnames": {"0": ["py", "module", "Python module"], "1": ["py", "function", "Python function"]}, "objtypes": {"0": "py:module", "1": "py:function"}, "terms": {"": 0, "0": 0, "1": 0, "2": 0, "9": 0, "A": 0, "For": 0, "It": 0, "The": 0, "There": 0, "aan": 0, "about": 0, "accommod": 0, "addit": 0, "addl_irregular": 0, "addl_sam": 0, "addl_special_": 0, "alwai": 0, "american": 0, "an": 0, "apa": 0, "apostroph": 0, "appli": 0, "applic": 0, "appropri": 0, "ar": 0, "articl": 0, "attempt": 0, "becaus": 0, "begin": 0, "between": 0, "brianwarn": 0, "can": 0, "caps_mod": 0, "case": 0, "cat": 0, "com": 0, "complic": 0, "consist": 0, "consumpt": 0, "contribut": 0, "convert": 0, "corner": 0, "current": 0, "default": 0, "depend": 0, "determin": 0, "dict": 0, "digit": 0, "don": 0, "e": 0, "els": 0, "en": 0, "end": 0, "english": 0, "equival": 0, "everyth": 0, "exampl": 0, "except": 0, "expand": 0, "extens": 0, "float": 0, "forc": 0, "form": 0, "format": 0, "g": 0, "gener": 0, "github": 0, "given": 0, "grammar": 0, "handl": 0, "hard": 0, "hello": 0, "human": 0, "i": 0, "infer": 0, "int": 0, "integ": 0, "intend": 0, "irregular": 0, "isar": 0, "item": 0, "its": 0, "know": 0, "languag": 0, "like": 0, "list": 0, "local": 0, "lower": 0, "made": 0, "manual": 0, "mice": 0, "most": 0, "mous": 0, "much": 0, "must": 0, "noun": 0, "num2word": 0, "number": 0, "odd": 0, "one": 0, "other": 0, "out": 0, "pair": 0, "paramet": 0, "peopl": 0, "per": 0, "person": 0, "piano": 0, "plural": 0, "possess": 0, "provid": 0, "punctuat": 0, "quaniti": 0, "quantiti": 0, "rais": 0, "reason": 0, "relat": 0, "repres": 0, "return": 0, "rule": 0, "same": 0, "should": 0, "singular": 0, "situat": 0, "smooth": 0, "so": 0, "soft": 0, "sourc": 0, "specif": 0, "specifi": 0, "str": 0, "string": 0, "style": 0, "suffix": 0, "suppli": 0, "support": 0, "t": 0, "text": 0, "thi": 0, "try": 0, "two": 0, "type": 0, "typeerror": 0, "u": 0, "upon": 0, "upper": 0, "us": 0, "user": 0, "v": 0, "valueerror": 0, "vowel": 0, "w": 0, "wa": 0, "waswer": 0, "welcom": 0, "were": 0, "when": 0, "where": 0, "whether": 0, "which": 0, "word": 0, "written": 0, "you": 0}, "titles": ["talkGooder documentation"], "titleterms": {"document": 0, "function": 0, "gooder": 0, "talk": 0, "talkgood": 0}}) \ No newline at end of file