Skip to content

Commit 29aef7d

Browse files
committed
FIX raise NotImplementedError for ipsyn
1 parent 0526bfb commit 29aef7d

9 files changed

Lines changed: 31 additions & 23 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/).
1919
- Fixed the previously inoperational methods `append`, `append_left`, `extend`, and `extend_left`
2020
of the class `CHATReader` through the upstream PyLangAcq package.
2121
- Retrained the part-of-speech tagger, after the minor character fix from v3.2.3.
22+
- Raised `NotImplementedError` for the method `ipsyn` of `CHATReader`,
23+
since the upstream method works only for English.
2224

2325
## [3.2.3] - 2021-04-12
2426

docs/_modules/pycantonese/corpus.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,13 @@ <h1>Source code for pycantonese.corpus</h1><div class="highlight"><pre>
365365
<span class="sd"> which may or may not be applicable to your use case.</span>
366366
<span class="sd"> &quot;&quot;&quot;</span>
367367

368+
<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>
369+
<span class="sd">&quot;&quot;&quot;(Not implemented - the upstream ``ipsyn`` method works for English only.)&quot;&quot;&quot;</span>
370+
<span class="k">raise</span> <span class="ne">NotImplementedError</span><span class="p">(</span>
371+
<span class="s2">&quot;The upstream `ipsyn` method works for English only. &quot;</span>
372+
<span class="s2">&quot;There isn&#39;t yet a Cantonese version of IPSyn.&quot;</span>
373+
<span class="p">)</span></div>
374+
368375
<span class="nd">@staticmethod</span>
369376
<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>
370377
<span class="c1"># Examples from the CHILDES LeeWongLeung corpus, child mhz</span>

docs/_sources/changelog.rst.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ Fixed
3434
* Fixed the previously inoperational methods ``append``\ , ``append_left``\ , ``extend``\ , and ``extend_left``
3535
of the class ``CHATReader`` through the upstream PyLangAcq package.
3636
* Retrained the part-of-speech tagger, after the minor character fix from v3.2.3.
37+
* Raised ``NotImplementedError`` for the method ``ipsyn`` of ``CHATReader``\ ,
38+
since the upstream method works only for English.
3739

3840
[3.2.3] - 2021-04-12
3941
--------------------

docs/api.html

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -449,8 +449,8 @@ <h2><a class="reference internal" href="generated/pycantonese.CHATReader.html#py
449449
<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>
450450
<td><p>Return the headers.</p></td>
451451
</tr>
452-
<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>
453-
<td><p>Return the indexes of productive syntax (IPSyn).</p></td>
452+
<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>
453+
<td><p>(Not implemented - the upstream <code class="docutils literal notranslate"><span class="pre">ipsyn</span></code> method works for English only.)</p></td>
454454
</tr>
455455
<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>
456456
<td><p>Return the data in Jyutping romanization.</p></td>
@@ -867,22 +867,8 @@ <h2><a class="reference internal" href="generated/pycantonese.CHATReader.html#py
867867

868868
<dl class="py method">
869869
<dt id="pycantonese.CHATReader.ipsyn">
870-
<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>
871-
<dd><p>Return the indexes of productive syntax (IPSyn).</p>
872-
<dl class="field-list simple">
873-
<dt class="field-odd">Parameters</dt>
874-
<dd class="field-odd"><dl class="simple">
875-
<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>
876-
for the target child.</p>
877-
</dd>
878-
</dl>
879-
</dd>
880-
<dt class="field-even">Returns</dt>
881-
<dd class="field-even"><dl class="simple">
882-
<dt>List[float]</dt><dd></dd>
883-
</dl>
884-
</dd>
885-
</dl>
870+
<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>
871+
<dd><p>(Not implemented - the upstream <code class="docutils literal notranslate"><span class="pre">ipsyn</span></code> method works for English only.)</p>
886872
</dd></dl>
887873

888874
<dl class="py method">

docs/changelog.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,8 @@ <h3>Fixed<a class="headerlink" href="#id3" title="Permalink to this headline">¶
345345
<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>
346346
of the class <code class="docutils literal notranslate"><span class="pre">CHATReader</span></code> through the upstream PyLangAcq package.</p></li>
347347
<li><p>Retrained the part-of-speech tagger, after the minor character fix from v3.2.3.</p></li>
348+
<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>,
349+
since the upstream method works only for English.</p></li>
348350
</ul>
349351
</div>
350352
</div>

docs/generated/pycantonese.CHATReader.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -377,8 +377,8 @@ <h1>pycantonese.CHATReader<a class="headerlink" href="#pycantonese-chatreader" t
377377
<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>
378378
<td><p>Return the headers.</p></td>
379379
</tr>
380-
<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>
381-
<td><p>Return the indexes of productive syntax (IPSyn).</p></td>
380+
<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>
381+
<td><p>(Not implemented - the upstream <code class="docutils literal notranslate"><span class="pre">ipsyn</span></code> method works for English only.)</p></td>
382382
</tr>
383383
<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>
384384
<td><p>Return the data in Jyutping romanization.</p></td>
@@ -517,8 +517,8 @@ <h1>pycantonese.CHATReader<a class="headerlink" href="#pycantonese-chatreader" t
517517
<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>
518518
<td><p>Return the headers.</p></td>
519519
</tr>
520-
<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>
521-
<td><p>Return the indexes of productive syntax (IPSyn).</p></td>
520+
<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>
521+
<td><p>(Not implemented - the upstream <code class="docutils literal notranslate"><span class="pre">ipsyn</span></code> method works for English only.)</p></td>
522522
</tr>
523523
<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>
524524
<td><p>Return the data in Jyutping romanization.</p></td>

docs/searchindex.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/source/changelog.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ Fixed
3434
* Fixed the previously inoperational methods ``append``\ , ``append_left``\ , ``extend``\ , and ``extend_left``
3535
of the class ``CHATReader`` through the upstream PyLangAcq package.
3636
* Retrained the part-of-speech tagger, after the minor character fix from v3.2.3.
37+
* Raised ``NotImplementedError`` for the method ``ipsyn`` of ``CHATReader``\ ,
38+
since the upstream method works only for English.
3739

3840
[3.2.3] - 2021-04-12
3941
--------------------

pycantonese/corpus.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,13 @@ class CHATReader(Reader):
5050
which may or may not be applicable to your use case.
5151
"""
5252

53+
def ipsyn(self):
54+
"""(Not implemented - the upstream ``ipsyn`` method works for English only.)"""
55+
raise NotImplementedError(
56+
"The upstream `ipsyn` method works for English only. "
57+
"There isn't yet a Cantonese version of IPSyn."
58+
)
59+
5360
@staticmethod
5461
def _preprocess_token(t) -> Token:
5562
# Examples from the CHILDES LeeWongLeung corpus, child mhz

0 commit comments

Comments
 (0)