Skip to content

Commit

Permalink
FIX raise NotImplementedError for ipsyn
Browse files Browse the repository at this point in the history
  • Loading branch information
jacksonllee committed May 8, 2021
1 parent 0526bfb commit 29aef7d
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 23 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/).
- Fixed the previously inoperational methods `append`, `append_left`, `extend`, and `extend_left`
of the class `CHATReader` through the upstream PyLangAcq package.
- Retrained the part-of-speech tagger, after the minor character fix from v3.2.3.
- Raised `NotImplementedError` for the method `ipsyn` of `CHATReader`,
since the upstream method works only for English.

## [3.2.3] - 2021-04-12

Expand Down
7 changes: 7 additions & 0 deletions docs/_modules/pycantonese/corpus.html
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,13 @@ <h1>Source code for pycantonese.corpus</h1><div class="highlight"><pre>
<span class="sd"> which may or may not be applicable to your use case.</span>
<span class="sd"> &quot;&quot;&quot;</span>

<div class="viewcode-block" id="CHATReader.ipsyn"><a class="viewcode-back" href="../../api.html#pycantonese.CHATReader.ipsyn">[docs]</a> <span class="k">def</span> <span class="nf">ipsyn</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;(Not implemented - the upstream ``ipsyn`` method works for English only.)&quot;&quot;&quot;</span>
<span class="k">raise</span> <span class="ne">NotImplementedError</span><span class="p">(</span>
<span class="s2">&quot;The upstream `ipsyn` method works for English only. &quot;</span>
<span class="s2">&quot;There isn&#39;t yet a Cantonese version of IPSyn.&quot;</span>
<span class="p">)</span></div>

<span class="nd">@staticmethod</span>
<span class="k">def</span> <span class="nf">_preprocess_token</span><span class="p">(</span><span class="n">t</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">Token</span><span class="p">:</span>
<span class="c1"># Examples from the CHILDES LeeWongLeung corpus, child mhz</span>
Expand Down
2 changes: 2 additions & 0 deletions docs/_sources/changelog.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ Fixed
* Fixed the previously inoperational methods ``append``\ , ``append_left``\ , ``extend``\ , and ``extend_left``
of the class ``CHATReader`` through the upstream PyLangAcq package.
* Retrained the part-of-speech tagger, after the minor character fix from v3.2.3.
* Raised ``NotImplementedError`` for the method ``ipsyn`` of ``CHATReader``\ ,
since the upstream method works only for English.

[3.2.3] - 2021-04-12
--------------------
Expand Down
22 changes: 4 additions & 18 deletions docs/api.html
Original file line number Diff line number Diff line change
Expand Up @@ -449,8 +449,8 @@ <h2><a class="reference internal" href="generated/pycantonese.CHATReader.html#py
<tr class="row-even"><td><p><a class="reference internal" href="#pycantonese.CHATReader.headers" title="pycantonese.CHATReader.headers"><code class="xref py py-obj docutils literal notranslate"><span class="pre">headers</span></code></a>()</p></td>
<td><p>Return the headers.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#pycantonese.CHATReader.ipsyn" title="pycantonese.CHATReader.ipsyn"><code class="xref py py-obj docutils literal notranslate"><span class="pre">ipsyn</span></code></a>([participant])</p></td>
<td><p>Return the indexes of productive syntax (IPSyn).</p></td>
<tr class="row-odd"><td><p><a class="reference internal" href="#pycantonese.CHATReader.ipsyn" title="pycantonese.CHATReader.ipsyn"><code class="xref py py-obj docutils literal notranslate"><span class="pre">ipsyn</span></code></a>()</p></td>
<td><p>(Not implemented - the upstream <code class="docutils literal notranslate"><span class="pre">ipsyn</span></code> method works for English only.)</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#pycantonese.CHATReader.jyutping" title="pycantonese.CHATReader.jyutping"><code class="xref py py-obj docutils literal notranslate"><span class="pre">jyutping</span></code></a>([participants, exclude, …])</p></td>
<td><p>Return the data in Jyutping romanization.</p></td>
Expand Down Expand Up @@ -867,22 +867,8 @@ <h2><a class="reference internal" href="generated/pycantonese.CHATReader.html#py

<dl class="py method">
<dt id="pycantonese.CHATReader.ipsyn">
<code class="sig-name descname">ipsyn</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">participant</span><span class="o">=</span><span class="default_value">'CHI'</span></em><span class="sig-paren">)</span> &#x2192; List<span class="p">[</span><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)">int</a><span class="p">]</span><a class="headerlink" href="#pycantonese.CHATReader.ipsyn" title="Permalink to this definition"></a></dt>
<dd><p>Return the indexes of productive syntax (IPSyn).</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><dl class="simple">
<dt><strong>participant</strong><span class="classifier">str, optional</span></dt><dd><p>Participant of interest, which defaults to the typical use case of <code class="docutils literal notranslate"><span class="pre">&quot;CHI&quot;</span></code>
for the target child.</p>
</dd>
</dl>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><dl class="simple">
<dt>List[float]</dt><dd></dd>
</dl>
</dd>
</dl>
<code class="sig-name descname">ipsyn</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pycantonese/corpus.html#CHATReader.ipsyn"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pycantonese.CHATReader.ipsyn" title="Permalink to this definition"></a></dt>
<dd><p>(Not implemented - the upstream <code class="docutils literal notranslate"><span class="pre">ipsyn</span></code> method works for English only.)</p>
</dd></dl>

<dl class="py method">
Expand Down
2 changes: 2 additions & 0 deletions docs/changelog.html
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,8 @@ <h3>Fixed<a class="headerlink" href="#id3" title="Permalink to this headline">¶
<li><p>Fixed the previously inoperational methods <code class="docutils literal notranslate"><span class="pre">append</span></code>, <code class="docutils literal notranslate"><span class="pre">append_left</span></code>, <code class="docutils literal notranslate"><span class="pre">extend</span></code>, and <code class="docutils literal notranslate"><span class="pre">extend_left</span></code>
of the class <code class="docutils literal notranslate"><span class="pre">CHATReader</span></code> through the upstream PyLangAcq package.</p></li>
<li><p>Retrained the part-of-speech tagger, after the minor character fix from v3.2.3.</p></li>
<li><p>Raised <code class="docutils literal notranslate"><span class="pre">NotImplementedError</span></code> for the method <code class="docutils literal notranslate"><span class="pre">ipsyn</span></code> of <code class="docutils literal notranslate"><span class="pre">CHATReader</span></code>,
since the upstream method works only for English.</p></li>
</ul>
</div>
</div>
Expand Down
8 changes: 4 additions & 4 deletions docs/generated/pycantonese.CHATReader.html
Original file line number Diff line number Diff line change
Expand Up @@ -377,8 +377,8 @@ <h1>pycantonese.CHATReader<a class="headerlink" href="#pycantonese-chatreader" t
<tr class="row-even"><td><p><a class="reference internal" href="../api.html#pycantonese.CHATReader.headers" title="pycantonese.CHATReader.headers"><code class="xref py py-obj docutils literal notranslate"><span class="pre">headers</span></code></a>()</p></td>
<td><p>Return the headers.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="../api.html#pycantonese.CHATReader.ipsyn" title="pycantonese.CHATReader.ipsyn"><code class="xref py py-obj docutils literal notranslate"><span class="pre">ipsyn</span></code></a>([participant])</p></td>
<td><p>Return the indexes of productive syntax (IPSyn).</p></td>
<tr class="row-odd"><td><p><a class="reference internal" href="../api.html#pycantonese.CHATReader.ipsyn" title="pycantonese.CHATReader.ipsyn"><code class="xref py py-obj docutils literal notranslate"><span class="pre">ipsyn</span></code></a>()</p></td>
<td><p>(Not implemented - the upstream <code class="docutils literal notranslate"><span class="pre">ipsyn</span></code> method works for English only.)</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="../api.html#pycantonese.CHATReader.jyutping" title="pycantonese.CHATReader.jyutping"><code class="xref py py-obj docutils literal notranslate"><span class="pre">jyutping</span></code></a>([participants, exclude, …])</p></td>
<td><p>Return the data in Jyutping romanization.</p></td>
Expand Down Expand Up @@ -517,8 +517,8 @@ <h1>pycantonese.CHATReader<a class="headerlink" href="#pycantonese-chatreader" t
<tr class="row-even"><td><p><a class="reference internal" href="../api.html#pycantonese.CHATReader.headers" title="pycantonese.CHATReader.headers"><code class="xref py py-obj docutils literal notranslate"><span class="pre">headers</span></code></a>()</p></td>
<td><p>Return the headers.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="../api.html#pycantonese.CHATReader.ipsyn" title="pycantonese.CHATReader.ipsyn"><code class="xref py py-obj docutils literal notranslate"><span class="pre">ipsyn</span></code></a>([participant])</p></td>
<td><p>Return the indexes of productive syntax (IPSyn).</p></td>
<tr class="row-odd"><td><p><a class="reference internal" href="../api.html#pycantonese.CHATReader.ipsyn" title="pycantonese.CHATReader.ipsyn"><code class="xref py py-obj docutils literal notranslate"><span class="pre">ipsyn</span></code></a>()</p></td>
<td><p>(Not implemented - the upstream <code class="docutils literal notranslate"><span class="pre">ipsyn</span></code> method works for English only.)</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="../api.html#pycantonese.CHATReader.jyutping" title="pycantonese.CHATReader.jyutping"><code class="xref py py-obj docutils literal notranslate"><span class="pre">jyutping</span></code></a>([participants, exclude, …])</p></td>
<td><p>Return the data in Jyutping romanization.</p></td>
Expand Down
2 changes: 1 addition & 1 deletion docs/searchindex.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions docs/source/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ Fixed
* Fixed the previously inoperational methods ``append``\ , ``append_left``\ , ``extend``\ , and ``extend_left``
of the class ``CHATReader`` through the upstream PyLangAcq package.
* Retrained the part-of-speech tagger, after the minor character fix from v3.2.3.
* Raised ``NotImplementedError`` for the method ``ipsyn`` of ``CHATReader``\ ,
since the upstream method works only for English.

[3.2.3] - 2021-04-12
--------------------
Expand Down
7 changes: 7 additions & 0 deletions pycantonese/corpus.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ class CHATReader(Reader):
which may or may not be applicable to your use case.
"""

def ipsyn(self):
"""(Not implemented - the upstream ``ipsyn`` method works for English only.)"""
raise NotImplementedError(
"The upstream `ipsyn` method works for English only. "
"There isn't yet a Cantonese version of IPSyn."
)

@staticmethod
def _preprocess_token(t) -> Token:
# Examples from the CHILDES LeeWongLeung corpus, child mhz
Expand Down

0 comments on commit 29aef7d

Please sign in to comment.