Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
Signed-off-by: Brian Warner <[email protected]>
  • Loading branch information
brianwarner committed Oct 8, 2024
1 parent f2e4048 commit cab6284
Show file tree
Hide file tree
Showing 10 changed files with 132 additions and 44 deletions.
2 changes: 1 addition & 1 deletion docs/.buildinfo
Original file line number Diff line number Diff line change
@@ -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
6 changes: 3 additions & 3 deletions docs/_modules/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Overview: module code &mdash; talkGooder 0.0.post1.dev1+gdebd171 documentation</title>
<title>Overview: module code &mdash; talkGooder 1.0.4.post1.dev2+g818c923.d20241008 documentation</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=80d5e7a1" />
<link rel="stylesheet" type="text/css" href="../_static/css/theme.css?v=19f00094" />

Expand All @@ -14,7 +14,7 @@

<script src="../_static/jquery.js?v=5d32c60e"></script>
<script src="../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="../_static/documentation_options.js?v=80a157c8"></script>
<script src="../_static/documentation_options.js?v=cf89239c"></script>
<script src="../_static/doctools.js?v=9a2dae69"></script>
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../_static/js/theme.js"></script>
Expand All @@ -36,7 +36,7 @@
talkGooder
</a>
<div class="version">
0.0.post1.dev1+gdebd171
1.0.4.post1.dev2+g818c923.d20241008
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
Expand Down
91 changes: 68 additions & 23 deletions docs/_modules/talkgooder.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>talkgooder &mdash; talkGooder 0.0.post1.dev1+gdebd171 documentation</title>
<title>talkgooder &mdash; talkGooder 1.0.4.post1.dev2+g818c923 documentation</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=80d5e7a1" />
<link rel="stylesheet" type="text/css" href="../_static/css/theme.css?v=19f00094" />

Expand All @@ -14,7 +14,7 @@

<script src="../_static/jquery.js?v=5d32c60e"></script>
<script src="../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="../_static/documentation_options.js?v=80a157c8"></script>
<script src="../_static/documentation_options.js?v=189e1421"></script>
<script src="../_static/doctools.js?v=9a2dae69"></script>
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../_static/js/theme.js"></script>
Expand All @@ -36,7 +36,7 @@
talkGooder
</a>
<div class="version">
0.0.post1.dev1+gdebd171
1.0.4.post1.dev2+g818c923
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
Expand Down Expand Up @@ -148,30 +148,30 @@ <h1>Source code for talkgooder</h1><div class="highlight"><pre>

<span class="c1"># Same singular as plural, can be extended via addl_same parameter</span>
<span class="n">en_us_same</span> <span class="o">=</span> <span class="p">[</span>
<span class="s2">&quot;sheep&quot;</span><span class="p">,</span>
<span class="s2">&quot;fish&quot;</span><span class="p">,</span>
<span class="s2">&quot;salmon&quot;</span><span class="p">,</span>
<span class="s2">&quot;aircraft&quot;</span><span class="p">,</span>
<span class="s2">&quot;buffalo&quot;</span><span class="p">,</span>
<span class="s2">&quot;deer&quot;</span><span class="p">,</span>
<span class="s2">&quot;fish&quot;</span><span class="p">,</span>
<span class="s2">&quot;goose&quot;</span><span class="p">,</span>
<span class="s2">&quot;hovercraft&quot;</span><span class="p">,</span>
<span class="s2">&quot;moose&quot;</span><span class="p">,</span>
<span class="s2">&quot;salmon&quot;</span><span class="p">,</span>
<span class="s2">&quot;sheep&quot;</span><span class="p">,</span>
<span class="s2">&quot;shrimp&quot;</span><span class="p">,</span>
<span class="s2">&quot;spacecraft&quot;</span><span class="p">,</span>
<span class="s2">&quot;trout&quot;</span><span class="p">,</span>
<span class="s2">&quot;aircraft&quot;</span><span class="p">,</span>
<span class="s2">&quot;watercraft&quot;</span><span class="p">,</span>
<span class="s2">&quot;hovercraft&quot;</span><span class="p">,</span>
<span class="s2">&quot;spacecraft&quot;</span><span class="p">,</span>
<span class="s2">&quot;deer&quot;</span><span class="p">,</span>
<span class="s2">&quot;goose&quot;</span><span class="p">,</span>
<span class="p">]</span> <span class="o">+</span> <span class="n">addl_same</span>

<span class="c1"># Doesn&#39;t follow other rules, plural is always s, can be extended via addl_special_s</span>
<span class="n">en_us_special_s</span> <span class="o">=</span> <span class="p">[</span>
<span class="s2">&quot;roof&quot;</span><span class="p">,</span>
<span class="s2">&quot;proof&quot;</span><span class="p">,</span>
<span class="s2">&quot;spoof&quot;</span><span class="p">,</span>
<span class="s2">&quot;piano&quot;</span><span class="p">,</span>
<span class="s2">&quot;cello&quot;</span><span class="p">,</span>
<span class="s2">&quot;hello&quot;</span><span class="p">,</span>
<span class="s2">&quot;photo&quot;</span><span class="p">,</span>
<span class="s2">&quot;piano&quot;</span><span class="p">,</span>
<span class="s2">&quot;proof&quot;</span><span class="p">,</span>
<span class="s2">&quot;roof&quot;</span><span class="p">,</span>
<span class="s2">&quot;spoof&quot;</span><span class="p">,</span>
<span class="s2">&quot;zero&quot;</span><span class="p">,</span>
<span class="p">]</span> <span class="o">+</span> <span class="n">addl_special_s</span>

Expand All @@ -180,16 +180,16 @@ <h1>Source code for talkgooder</h1><div class="highlight"><pre>
<span class="nb">list</span><span class="p">(</span>
<span class="p">{</span>
<span class="s2">&quot;child&quot;</span><span class="p">:</span> <span class="s2">&quot;children&quot;</span><span class="p">,</span>
<span class="s2">&quot;criterion&quot;</span><span class="p">:</span> <span class="s2">&quot;criteria&quot;</span><span class="p">,</span>
<span class="s2">&quot;die&quot;</span><span class="p">:</span> <span class="s2">&quot;dice&quot;</span><span class="p">,</span>
<span class="s2">&quot;louse&quot;</span><span class="p">:</span> <span class="s2">&quot;lice&quot;</span><span class="p">,</span>
<span class="s2">&quot;man&quot;</span><span class="p">:</span> <span class="s2">&quot;men&quot;</span><span class="p">,</span>
<span class="s2">&quot;mouse&quot;</span><span class="p">:</span> <span class="s2">&quot;mice&quot;</span><span class="p">,</span>
<span class="s2">&quot;ox&quot;</span><span class="p">:</span> <span class="s2">&quot;oxen&quot;</span><span class="p">,</span>
<span class="s2">&quot;person&quot;</span><span class="p">:</span> <span class="s2">&quot;people&quot;</span><span class="p">,</span>
<span class="s2">&quot;phenomenon&quot;</span><span class="p">:</span> <span class="s2">&quot;phenomena&quot;</span><span class="p">,</span>
<span class="s2">&quot;tooth&quot;</span><span class="p">:</span> <span class="s2">&quot;teeth&quot;</span><span class="p">,</span>
<span class="s2">&quot;ox&quot;</span><span class="p">:</span> <span class="s2">&quot;oxen&quot;</span><span class="p">,</span>
<span class="s2">&quot;mouse&quot;</span><span class="p">:</span> <span class="s2">&quot;mice&quot;</span><span class="p">,</span>
<span class="s2">&quot;man&quot;</span><span class="p">:</span> <span class="s2">&quot;men&quot;</span><span class="p">,</span>
<span class="s2">&quot;woman&quot;</span><span class="p">:</span> <span class="s2">&quot;women&quot;</span><span class="p">,</span>
<span class="s2">&quot;louse&quot;</span><span class="p">:</span> <span class="s2">&quot;lice&quot;</span><span class="p">,</span>
<span class="s2">&quot;die&quot;</span><span class="p">:</span> <span class="s2">&quot;dice&quot;</span><span class="p">,</span>
<span class="s2">&quot;phenomenon&quot;</span><span class="p">:</span> <span class="s2">&quot;phenomena&quot;</span><span class="p">,</span>
<span class="s2">&quot;criterion&quot;</span><span class="p">:</span> <span class="s2">&quot;criteria&quot;</span><span class="p">,</span>
<span class="p">}</span><span class="o">.</span><span class="n">items</span><span class="p">()</span>
<span class="p">)</span>
<span class="o">+</span> <span class="nb">list</span><span class="p">(</span><span class="n">addl_irregular</span><span class="o">.</span><span class="n">items</span><span class="p">())</span>
Expand Down Expand Up @@ -403,7 +403,7 @@ <h1>Source code for talkgooder</h1><div class="highlight"><pre>
<span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Given a quanity, determine if article should be ``is`` or ``are``.</span>

<span class="sd"> Given a quantity of nouns or noun-equivalents, determine whether the most article should be</span>
<span class="sd"> Given a quantity of nouns or noun-equivalents, determine whether the article should be</span>
<span class="sd"> ``is`` or ``are``. For example, &quot;there is one cat,&quot; and &quot;there are two cats.&quot;</span>

<span class="sd"> **Supported locales:**</span>
Expand Down Expand Up @@ -440,6 +440,51 @@ <h1>Source code for talkgooder</h1><div class="highlight"><pre>



<div class="viewcode-block" id="wasWere">
<a class="viewcode-back" href="../index.html#talkgooder.wasWere">[docs]</a>
<span class="k">def</span> <span class="nf">wasWere</span><span class="p">(</span>
<span class="n">number</span><span class="p">:</span> <span class="nb">int</span> <span class="o">|</span> <span class="nb">float</span><span class="p">,</span>
<span class="n">language</span><span class="o">=</span><span class="s2">&quot;en-US&quot;</span><span class="p">,</span>
<span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Given a quanity, determine if article should be ``ws`` or ``were``.</span>

<span class="sd"> Given a quantity of nouns or noun-equivalents, determine whether the article should be</span>
<span class="sd"> ``was`` or ``were``. For example, &quot;there was one cat,&quot; and &quot;there were two cats.&quot;</span>

<span class="sd"> **Supported locales:**</span>

<span class="sd"> * ``en-US``: American English</span>

<span class="sd"> Args:</span>
<span class="sd"> number (int | float):</span>
<span class="sd"> Quantity of items.</span>
<span class="sd"> language (str):</span>
<span class="sd"> Which language rules to apply, specified by locale (default ``en-US``).</span>

<span class="sd"> Returns:</span>
<span class="sd"> String:</span>
<span class="sd"> ``was`` or ``were``, as appropriate.</span>

<span class="sd"> Raises:</span>
<span class="sd"> TypeError: number must be an int or float.</span>
<span class="sd"> ValueError: language must be a supported locale.</span>
<span class="sd"> &quot;&quot;&quot;</span>

<span class="k">if</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">number</span><span class="p">,</span> <span class="p">(</span><span class="nb">int</span><span class="p">,</span> <span class="nb">float</span><span class="p">)):</span>
<span class="k">raise</span> <span class="ne">TypeError</span><span class="p">(</span><span class="s2">&quot;Number must be an int or a float.&quot;</span><span class="p">)</span>

<span class="k">if</span> <span class="n">language</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span> <span class="o">==</span> <span class="s2">&quot;en-us&quot;</span><span class="p">:</span>
<span class="c1"># Anything other than integer 1 (even 1.0) uses &quot;were&quot;</span>
<span class="k">if</span> <span class="n">number</span> <span class="o">==</span> <span class="mi">1</span> <span class="ow">and</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">number</span><span class="p">,</span> <span class="nb">int</span><span class="p">):</span>
<span class="k">return</span> <span class="s2">&quot;was&quot;</span>
<span class="k">else</span><span class="p">:</span>
<span class="k">return</span> <span class="s2">&quot;were&quot;</span>

<span class="k">else</span><span class="p">:</span>
<span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s2">&quot;Language must be a supported locale.&quot;</span><span class="p">)</span></div>



<div class="viewcode-block" id="aAn">
<a class="viewcode-back" href="../index.html#talkgooder.aAn">[docs]</a>
<span class="k">def</span> <span class="nf">aAn</span><span class="p">(</span>
Expand Down
2 changes: 1 addition & 1 deletion docs/_static/documentation_options.js
Original file line number Diff line number Diff line change
@@ -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',
Expand Down
15 changes: 12 additions & 3 deletions docs/genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Index &mdash; talkGooder 0.0.post1.dev1+gdebd171 documentation</title>
<title>Index &mdash; talkGooder 1.0.4.post1.dev2+g818c923.d20241008 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=80d5e7a1" />
<link rel="stylesheet" type="text/css" href="_static/css/theme.css?v=19f00094" />

Expand All @@ -14,7 +14,7 @@

<script src="_static/jquery.js?v=5d32c60e"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="_static/documentation_options.js?v=80a157c8"></script>
<script src="_static/documentation_options.js?v=cf89239c"></script>
<script src="_static/doctools.js?v=9a2dae69"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/js/theme.js"></script>
Expand All @@ -36,7 +36,7 @@
talkGooder
</a>
<div class="version">
0.0.post1.dev1+gdebd171
1.0.4.post1.dev2+g818c923.d20241008
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
Expand Down Expand Up @@ -81,6 +81,7 @@ <h1 id="index">Index</h1>
| <a href="#N"><strong>N</strong></a>
| <a href="#P"><strong>P</strong></a>
| <a href="#T"><strong>T</strong></a>
| <a href="#W"><strong>W</strong></a>

</div>
<h2 id="A">A</h2>
Expand Down Expand Up @@ -145,6 +146,14 @@ <h2 id="T">T</h2>
</ul></td>
</tr></table>

<h2 id="W">W</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#talkgooder.wasWere">wasWere() (in module talkgooder)</a>
</li>
</ul></td>
</tr></table>



</div>
Expand Down
Loading

0 comments on commit cab6284

Please sign in to comment.