Skip to content

Commit

Permalink
Merge pull request #25 from swerik-project/dev
Browse files Browse the repository at this point in the history
prerelease: patch version
  • Loading branch information
BobBorges authored Jan 15, 2025
2 parents 39a0be1 + d7001b4 commit 9aa6960
Show file tree
Hide file tree
Showing 21 changed files with 462 additions and 460 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ jobs:
- name: Validate CITATION.cff
uses: dieghernan/cff-validator@v3
with:
install-r: true

- name: Build documentation
run: |
Expand Down
2 changes: 1 addition & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cff-version: 1.2.0
message: To cite this reposository, please use these metadata.
title: "The Swedish Parliament Corpus: pyriksdagen"
version: v1.7.0
version: v1.7.1
authors:
- given-names: Väinö
family-names: Yrjänäinen
Expand Down
2 changes: 1 addition & 1 deletion docs/pyriksdagen.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ <h2>Submodules</h2>
</ul>


<footer>v1.7.0</footer>
<footer>v1.7.1</footer>

<a class="attribution" title="pdoc: Python API documentation generator" href="https://pdoc.dev" target="_blank">
built with <span class="visually-hidden">pdoc</span><img
Expand Down
62 changes: 31 additions & 31 deletions docs/pyriksdagen/args.html

Large diffs are not rendered by default.

42 changes: 21 additions & 21 deletions docs/pyriksdagen/dataset.html

Large diffs are not rendered by default.

32 changes: 16 additions & 16 deletions docs/pyriksdagen/date_handling.html

Large diffs are not rendered by default.

42 changes: 21 additions & 21 deletions docs/pyriksdagen/db.html

Large diffs are not rendered by default.

68 changes: 34 additions & 34 deletions docs/pyriksdagen/download.html

Large diffs are not rendered by default.

32 changes: 16 additions & 16 deletions docs/pyriksdagen/export.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ <h2>API Documentation</h2>
</ul>


<footer>v1.7.0</footer>
<footer>v1.7.1</footer>

<a class="attribution" title="pdoc: Python API documentation generator" href="https://pdoc.dev" target="_blank">
built with <span class="visually-hidden">pdoc</span><img
Expand All @@ -70,16 +70,16 @@ <h1 class="modulename">
<div class="pdoc-code codehilite"><pre><span></span><span id="L-1"><a href="#L-1"><span class="linenos"> 1</span></a><span class="sd">&quot;&quot;&quot;</span>
</span><span id="L-2"><a href="#L-2"><span class="linenos"> 2</span></a><span class="sd">Parla Clarin generation</span>
</span><span id="L-3"><a href="#L-3"><span class="linenos"> 3</span></a><span class="sd">&quot;&quot;&quot;</span>
</span><span id="L-4"><a href="#L-4"><span class="linenos"> 4</span></a><span class="kn">import</span> <span class="nn">pandas</span> <span class="k">as</span> <span class="nn">pd</span>
</span><span id="L-5"><a href="#L-5"><span class="linenos"> 5</span></a><span class="kn">import</span> <span class="nn">progressbar</span><span class="o">,</span> <span class="nn">copy</span>
</span><span id="L-6"><a href="#L-6"><span class="linenos"> 6</span></a><span class="kn">from</span> <span class="nn">lxml</span> <span class="kn">import</span> <span class="n">etree</span>
</span><span id="L-7"><a href="#L-7"><span class="linenos"> 7</span></a><span class="kn">from</span> <span class="nn">pyparlaclarin.create</span> <span class="kn">import</span> <span class="n">pc_header</span><span class="p">,</span> <span class="n">create_parlaclarin</span>
</span><span id="L-8"><a href="#L-8"><span class="linenos"> 8</span></a><span class="kn">from</span> <span class="nn">pyparlaclarin.refine</span> <span class="kn">import</span> <span class="n">format_texts</span>
</span><span id="L-4"><a href="#L-4"><span class="linenos"> 4</span></a><span class="kn">import</span><span class="w"> </span><span class="nn">pandas</span><span class="w"> </span><span class="k">as</span><span class="w"> </span><span class="nn">pd</span>
</span><span id="L-5"><a href="#L-5"><span class="linenos"> 5</span></a><span class="kn">import</span><span class="w"> </span><span class="nn">progressbar</span><span class="o">,</span><span class="w"> </span><span class="nn">copy</span>
</span><span id="L-6"><a href="#L-6"><span class="linenos"> 6</span></a><span class="kn">from</span><span class="w"> </span><span class="nn">lxml</span><span class="w"> </span><span class="kn">import</span> <span class="n">etree</span>
</span><span id="L-7"><a href="#L-7"><span class="linenos"> 7</span></a><span class="kn">from</span><span class="w"> </span><span class="nn">pyparlaclarin.create</span><span class="w"> </span><span class="kn">import</span> <span class="n">pc_header</span><span class="p">,</span> <span class="n">create_parlaclarin</span>
</span><span id="L-8"><a href="#L-8"><span class="linenos"> 8</span></a><span class="kn">from</span><span class="w"> </span><span class="nn">pyparlaclarin.refine</span><span class="w"> </span><span class="kn">import</span> <span class="n">format_texts</span>
</span><span id="L-9"><a href="#L-9"><span class="linenos"> 9</span></a>
</span><span id="L-10"><a href="#L-10"><span class="linenos"> 10</span></a><span class="kn">from</span> <span class="nn">.utils</span> <span class="kn">import</span> <span class="n">infer_metadata</span><span class="p">,</span> <span class="n">get_formatted_uuid</span><span class="p">,</span> <span class="n">get_data_location</span><span class="p">,</span> <span class="n">XML_NS</span><span class="p">,</span> <span class="n">TEI_NS</span>
</span><span id="L-11"><a href="#L-11"><span class="linenos"> 11</span></a><span class="kn">from</span> <span class="nn">.db</span> <span class="kn">import</span> <span class="n">year_iterator</span>
</span><span id="L-10"><a href="#L-10"><span class="linenos"> 10</span></a><span class="kn">from</span><span class="w"> </span><span class="nn">.utils</span><span class="w"> </span><span class="kn">import</span> <span class="n">infer_metadata</span><span class="p">,</span> <span class="n">get_formatted_uuid</span><span class="p">,</span> <span class="n">get_data_location</span><span class="p">,</span> <span class="n">XML_NS</span><span class="p">,</span> <span class="n">TEI_NS</span>
</span><span id="L-11"><a href="#L-11"><span class="linenos"> 11</span></a><span class="kn">from</span><span class="w"> </span><span class="nn">.db</span><span class="w"> </span><span class="kn">import</span> <span class="n">year_iterator</span>
</span><span id="L-12"><a href="#L-12"><span class="linenos"> 12</span></a>
</span><span id="L-13"><a href="#L-13"><span class="linenos"> 13</span></a><span class="k">def</span> <span class="nf">dict_to_tei</span><span class="p">(</span><span class="n">data</span><span class="p">):</span>
</span><span id="L-13"><a href="#L-13"><span class="linenos"> 13</span></a><span class="k">def</span><span class="w"> </span><span class="nf">dict_to_tei</span><span class="p">(</span><span class="n">data</span><span class="p">):</span>
</span><span id="L-14"><a href="#L-14"><span class="linenos"> 14</span></a><span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
</span><span id="L-15"><a href="#L-15"><span class="linenos"> 15</span></a><span class="sd"> Convert a metadata dict into a TEI XML tree</span>
</span><span id="L-16"><a href="#L-16"><span class="linenos"> 16</span></a>
Expand Down Expand Up @@ -135,7 +135,7 @@ <h1 class="modulename">
</span><span id="L-66"><a href="#L-66"><span class="linenos"> 66</span></a>
</span><span id="L-67"><a href="#L-67"><span class="linenos"> 67</span></a> <span class="k">return</span> <span class="n">tei</span>
</span><span id="L-68"><a href="#L-68"><span class="linenos"> 68</span></a>
</span><span id="L-69"><a href="#L-69"><span class="linenos"> 69</span></a><span class="k">def</span> <span class="nf">add_to_corpus_meta_file_list</span><span class="p">(</span><span class="n">metadata</span><span class="p">):</span>
</span><span id="L-69"><a href="#L-69"><span class="linenos"> 69</span></a><span class="k">def</span><span class="w"> </span><span class="nf">add_to_corpus_meta_file_list</span><span class="p">(</span><span class="n">metadata</span><span class="p">):</span>
</span><span id="L-70"><a href="#L-70"><span class="linenos"> 70</span></a><span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
</span><span id="L-71"><a href="#L-71"><span class="linenos"> 71</span></a><span class="sd"> add entry to corpus-level metadata xml files</span>
</span><span id="L-72"><a href="#L-72"><span class="linenos"> 72</span></a><span class="sd"> &quot;&quot;&quot;</span>
Expand Down Expand Up @@ -164,7 +164,7 @@ <h1 class="modulename">
</span><span id="L-95"><a href="#L-95"><span class="linenos"> 95</span></a>
</span><span id="L-96"><a href="#L-96"><span class="linenos"> 96</span></a>
</span><span id="L-97"><a href="#L-97"><span class="linenos"> 97</span></a>
</span><span id="L-98"><a href="#L-98"><span class="linenos"> 98</span></a><span class="k">def</span> <span class="nf">dict_to_parlaclarin</span><span class="p">(</span><span class="n">data</span><span class="p">):</span>
</span><span id="L-98"><a href="#L-98"><span class="linenos"> 98</span></a><span class="k">def</span><span class="w"> </span><span class="nf">dict_to_parlaclarin</span><span class="p">(</span><span class="n">data</span><span class="p">):</span>
</span><span id="L-99"><a href="#L-99"><span class="linenos"> 99</span></a><span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
</span><span id="L-100"><a href="#L-100"><span class="linenos">100</span></a><span class="sd"> Create per-protocol parlaclarin files of all files provided in file_db.</span>
</span><span id="L-101"><a href="#L-101"><span class="linenos">101</span></a><span class="sd"> Does not return anything, instead writes the data on disk.</span>
Expand Down Expand Up @@ -213,7 +213,7 @@ <h1 class="modulename">
</span><span id="L-144"><a href="#L-144"><span class="linenos">144</span></a> <span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">b</span><span class="p">)</span>
</span><span id="L-145"><a href="#L-145"><span class="linenos">145</span></a>
</span><span id="L-146"><a href="#L-146"><span class="linenos">146</span></a>
</span><span id="L-147"><a href="#L-147"><span class="linenos">147</span></a><span class="k">def</span> <span class="nf">zero_pad_prot_nr</span><span class="p">(</span><span class="n">protocol_id</span><span class="p">):</span>
</span><span id="L-147"><a href="#L-147"><span class="linenos">147</span></a><span class="k">def</span><span class="w"> </span><span class="nf">zero_pad_prot_nr</span><span class="p">(</span><span class="n">protocol_id</span><span class="p">):</span>
</span><span id="L-148"><a href="#L-148"><span class="linenos">148</span></a> <span class="n">constituents</span> <span class="o">=</span> <span class="n">protocol_id</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s1">&#39;-&#39;</span><span class="p">)</span>
</span><span id="L-149"><a href="#L-149"><span class="linenos">149</span></a> <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">constituents</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">1</span><span class="p">:</span>
</span><span id="L-150"><a href="#L-150"><span class="linenos">150</span></a> <span class="n">id_nr</span> <span class="o">=</span> <span class="s1">&#39;</span><span class="si">{:0&gt;3}</span><span class="s1">&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">constituents</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">])</span>
Expand Down Expand Up @@ -242,7 +242,7 @@ <h1 class="modulename">

</div>
<a class="headerlink" href="#dict_to_tei"></a>
<div class="pdoc-code codehilite"><pre><span></span><span id="dict_to_tei-14"><a href="#dict_to_tei-14"><span class="linenos">14</span></a><span class="k">def</span> <span class="nf">dict_to_tei</span><span class="p">(</span><span class="n">data</span><span class="p">):</span>
<div class="pdoc-code codehilite"><pre><span></span><span id="dict_to_tei-14"><a href="#dict_to_tei-14"><span class="linenos">14</span></a><span class="k">def</span><span class="w"> </span><span class="nf">dict_to_tei</span><span class="p">(</span><span class="n">data</span><span class="p">):</span>
</span><span id="dict_to_tei-15"><a href="#dict_to_tei-15"><span class="linenos">15</span></a><span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
</span><span id="dict_to_tei-16"><a href="#dict_to_tei-16"><span class="linenos">16</span></a><span class="sd"> Convert a metadata dict into a TEI XML tree</span>
</span><span id="dict_to_tei-17"><a href="#dict_to_tei-17"><span class="linenos">17</span></a>
Expand Down Expand Up @@ -322,7 +322,7 @@ <h1 class="modulename">

</div>
<a class="headerlink" href="#add_to_corpus_meta_file_list"></a>
<div class="pdoc-code codehilite"><pre><span></span><span id="add_to_corpus_meta_file_list-70"><a href="#add_to_corpus_meta_file_list-70"><span class="linenos">70</span></a><span class="k">def</span> <span class="nf">add_to_corpus_meta_file_list</span><span class="p">(</span><span class="n">metadata</span><span class="p">):</span>
<div class="pdoc-code codehilite"><pre><span></span><span id="add_to_corpus_meta_file_list-70"><a href="#add_to_corpus_meta_file_list-70"><span class="linenos">70</span></a><span class="k">def</span><span class="w"> </span><span class="nf">add_to_corpus_meta_file_list</span><span class="p">(</span><span class="n">metadata</span><span class="p">):</span>
</span><span id="add_to_corpus_meta_file_list-71"><a href="#add_to_corpus_meta_file_list-71"><span class="linenos">71</span></a><span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
</span><span id="add_to_corpus_meta_file_list-72"><a href="#add_to_corpus_meta_file_list-72"><span class="linenos">72</span></a><span class="sd"> add entry to corpus-level metadata xml files</span>
</span><span id="add_to_corpus_meta_file_list-73"><a href="#add_to_corpus_meta_file_list-73"><span class="linenos">73</span></a><span class="sd"> &quot;&quot;&quot;</span>
Expand Down Expand Up @@ -367,7 +367,7 @@ <h1 class="modulename">

</div>
<a class="headerlink" href="#dict_to_parlaclarin"></a>
<div class="pdoc-code codehilite"><pre><span></span><span id="dict_to_parlaclarin-99"><a href="#dict_to_parlaclarin-99"><span class="linenos"> 99</span></a><span class="k">def</span> <span class="nf">dict_to_parlaclarin</span><span class="p">(</span><span class="n">data</span><span class="p">):</span>
<div class="pdoc-code codehilite"><pre><span></span><span id="dict_to_parlaclarin-99"><a href="#dict_to_parlaclarin-99"><span class="linenos"> 99</span></a><span class="k">def</span><span class="w"> </span><span class="nf">dict_to_parlaclarin</span><span class="p">(</span><span class="n">data</span><span class="p">):</span>
</span><span id="dict_to_parlaclarin-100"><a href="#dict_to_parlaclarin-100"><span class="linenos">100</span></a><span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
</span><span id="dict_to_parlaclarin-101"><a href="#dict_to_parlaclarin-101"><span class="linenos">101</span></a><span class="sd"> Create per-protocol parlaclarin files of all files provided in file_db.</span>
</span><span id="dict_to_parlaclarin-102"><a href="#dict_to_parlaclarin-102"><span class="linenos">102</span></a><span class="sd"> Does not return anything, instead writes the data on disk.</span>
Expand Down Expand Up @@ -440,7 +440,7 @@ <h1 class="modulename">

</div>
<a class="headerlink" href="#zero_pad_prot_nr"></a>
<div class="pdoc-code codehilite"><pre><span></span><span id="zero_pad_prot_nr-148"><a href="#zero_pad_prot_nr-148"><span class="linenos">148</span></a><span class="k">def</span> <span class="nf">zero_pad_prot_nr</span><span class="p">(</span><span class="n">protocol_id</span><span class="p">):</span>
<div class="pdoc-code codehilite"><pre><span></span><span id="zero_pad_prot_nr-148"><a href="#zero_pad_prot_nr-148"><span class="linenos">148</span></a><span class="k">def</span><span class="w"> </span><span class="nf">zero_pad_prot_nr</span><span class="p">(</span><span class="n">protocol_id</span><span class="p">):</span>
</span><span id="zero_pad_prot_nr-149"><a href="#zero_pad_prot_nr-149"><span class="linenos">149</span></a> <span class="n">constituents</span> <span class="o">=</span> <span class="n">protocol_id</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s1">&#39;-&#39;</span><span class="p">)</span>
</span><span id="zero_pad_prot_nr-150"><a href="#zero_pad_prot_nr-150"><span class="linenos">150</span></a> <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">constituents</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">1</span><span class="p">:</span>
</span><span id="zero_pad_prot_nr-151"><a href="#zero_pad_prot_nr-151"><span class="linenos">151</span></a> <span class="n">id_nr</span> <span class="o">=</span> <span class="s1">&#39;</span><span class="si">{:0&gt;3}</span><span class="s1">&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">constituents</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">])</span>
Expand Down
Loading

0 comments on commit 9aa6960

Please sign in to comment.