Skip to content

Commit 1f7354f

Browse files
1 parent 0ee327d commit 1f7354f

File tree

110 files changed

+480
-212
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+480
-212
lines changed

.buildinfo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Sphinx build info version 1
22
# This file records the configuration used when building these files. When it is not found, a full rebuild will be done.
3-
config: 327e61378ba639c082f8c6a4b52e98ce
3+
config: b5e64a063d2dcc36aadf30922c833227
44
tags: 645f666f9bcd5a90fca523b33c5a78b7

_modules/index.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
<head>
66
<meta charset="utf-8" />
77
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
8-
<title>Overview: module code &mdash; PyThaiNLP 372ced4 documentation</title>
8+
<title>Overview: module code &mdash; PyThaiNLP 9a1ca86 documentation</title>
99
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=03e43079" />
1010
<link rel="stylesheet" type="text/css" href="../_static/css/theme.css?v=e59714d7" />
1111
<link rel="stylesheet" type="text/css" href="../_static/style.css?v=eea1f72d" />
1212

1313

1414
<script src="../_static/jquery.js?v=5d32c60e"></script>
1515
<script src="../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
16-
<script src="../_static/documentation_options.js?v=8c12b5f7"></script>
16+
<script src="../_static/documentation_options.js?v=65404f25"></script>
1717
<script src="../_static/doctools.js?v=9bcbadda"></script>
1818
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
1919
<script src="../_static/js/theme.js"></script>
@@ -106,6 +106,7 @@
106106

107107
<h1>All modules for which code is available</h1>
108108
<ul><li><a href="pythainlp/ancient/aksonhan.html">pythainlp.ancient.aksonhan</a></li>
109+
<li><a href="pythainlp/ancient/currency.html">pythainlp.ancient.currency</a></li>
109110
<li><a href="pythainlp/coref/core.html">pythainlp.coref.core</a></li>
110111
<li><a href="pythainlp/corpus/common.html">pythainlp.corpus.common</a></li>
111112
<li><a href="pythainlp/corpus/core.html">pythainlp.corpus.core</a></li>

_modules/pythainlp/ancient/aksonhan.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
<head>
66
<meta charset="utf-8" />
77
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
8-
<title>pythainlp.ancient.aksonhan &mdash; PyThaiNLP 372ced4 documentation</title>
8+
<title>pythainlp.ancient.aksonhan &mdash; PyThaiNLP 9a1ca86 documentation</title>
99
<link rel="stylesheet" type="text/css" href="../../../_static/pygments.css?v=03e43079" />
1010
<link rel="stylesheet" type="text/css" href="../../../_static/css/theme.css?v=e59714d7" />
1111
<link rel="stylesheet" type="text/css" href="../../../_static/style.css?v=eea1f72d" />
1212

1313

1414
<script src="../../../_static/jquery.js?v=5d32c60e"></script>
1515
<script src="../../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
16-
<script src="../../../_static/documentation_options.js?v=8c12b5f7"></script>
16+
<script src="../../../_static/documentation_options.js?v=65404f25"></script>
1717
<script src="../../../_static/doctools.js?v=9bcbadda"></script>
1818
<script src="../../../_static/sphinx_highlight.js?v=dc90522c"></script>
1919
<script src="../../../_static/js/theme.js"></script>
Lines changed: 211 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,211 @@
1+
2+
3+
<!DOCTYPE html>
4+
<html class="writer-html5" lang="en" data-content_root="../../../">
5+
<head>
6+
<meta charset="utf-8" />
7+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
8+
<title>pythainlp.ancient.currency &mdash; PyThaiNLP 9a1ca86 documentation</title>
9+
<link rel="stylesheet" type="text/css" href="../../../_static/pygments.css?v=03e43079" />
10+
<link rel="stylesheet" type="text/css" href="../../../_static/css/theme.css?v=e59714d7" />
11+
<link rel="stylesheet" type="text/css" href="../../../_static/style.css?v=eea1f72d" />
12+
13+
14+
<script src="../../../_static/jquery.js?v=5d32c60e"></script>
15+
<script src="../../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
16+
<script src="../../../_static/documentation_options.js?v=65404f25"></script>
17+
<script src="../../../_static/doctools.js?v=9bcbadda"></script>
18+
<script src="../../../_static/sphinx_highlight.js?v=dc90522c"></script>
19+
<script src="../../../_static/js/theme.js"></script>
20+
<link rel="index" title="Index" href="../../../genindex.html" />
21+
<link rel="search" title="Search" href="../../../search.html" />
22+
</head>
23+
24+
<body class="wy-body-for-nav">
25+
<div class="wy-grid-for-nav">
26+
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
27+
<div class="wy-side-scroll">
28+
<div class="wy-side-nav-search" >
29+
30+
31+
32+
<a href="../../../index.html" class="icon icon-home">
33+
PyThaiNLP
34+
</a>
35+
<div role="search">
36+
<form id="rtd-search-form" class="wy-form" action="../../../search.html" method="get">
37+
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
38+
<input type="hidden" name="check_keywords" value="yes" />
39+
<input type="hidden" name="area" value="default" />
40+
</form>
41+
</div>
42+
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
43+
<p class="caption" role="heading"><span class="caption-text">Notes</span></p>
44+
<ul>
45+
<li class="toctree-l1"><a class="reference internal" href="../../../notes/FAQ.html">FAQ</a></li>
46+
<li class="toctree-l1"><a class="reference internal" href="../../../notes/command_line.html">Command Line</a></li>
47+
<li class="toctree-l1"><a class="reference internal" href="../../../notes/getting_started.html">Getting Started</a></li>
48+
<li class="toctree-l1"><a class="reference internal" href="../../../notes/getting_started.html#tutorial-notebooks">Tutorial Notebooks</a></li>
49+
<li class="toctree-l1"><a class="reference internal" href="../../../notes/installation.html">Installation</a></li>
50+
<li class="toctree-l1"><a class="reference internal" href="../../../notes/installation.html#faq">FAQ</a></li>
51+
<li class="toctree-l1"><a class="reference internal" href="../../../notes/license.html">License</a></li>
52+
</ul>
53+
<p class="caption" role="heading"><span class="caption-text">Package reference:</span></p>
54+
<ul>
55+
<li class="toctree-l1"><a class="reference internal" href="../../../api/ancient.html">pythainlp.ancient</a></li>
56+
<li class="toctree-l1"><a class="reference internal" href="../../../api/augment.html">pythainlp.augment</a></li>
57+
<li class="toctree-l1"><a class="reference internal" href="../../../api/benchmarks.html">pythainlp.benchmarks</a></li>
58+
<li class="toctree-l1"><a class="reference internal" href="../../../api/chat.html">pythainlp.chat</a></li>
59+
<li class="toctree-l1"><a class="reference internal" href="../../../api/classify.html">pythainlp.classify</a></li>
60+
<li class="toctree-l1"><a class="reference internal" href="../../../api/coref.html">pythainlp.coref</a></li>
61+
<li class="toctree-l1"><a class="reference internal" href="../../../api/corpus.html">pythainlp.corpus</a></li>
62+
<li class="toctree-l1"><a class="reference internal" href="../../../api/el.html">pythainlp.el</a></li>
63+
<li class="toctree-l1"><a class="reference internal" href="../../../api/generate.html">pythainlp.generate</a></li>
64+
<li class="toctree-l1"><a class="reference internal" href="../../../api/khavee.html">pythainlp.khavee</a></li>
65+
<li class="toctree-l1"><a class="reference internal" href="../../../api/lm.html">pythainlp.lm</a></li>
66+
<li class="toctree-l1"><a class="reference internal" href="../../../api/morpheme.html">pythainlp.morpheme</a></li>
67+
<li class="toctree-l1"><a class="reference internal" href="../../../api/parse.html">pythainlp.parse</a></li>
68+
<li class="toctree-l1"><a class="reference internal" href="../../../api/phayathaibert.html">pythainlp.phayathaibert</a></li>
69+
<li class="toctree-l1"><a class="reference internal" href="../../../api/soundex.html">pythainlp.soundex</a></li>
70+
<li class="toctree-l1"><a class="reference internal" href="../../../api/spell.html">pythainlp.spell</a></li>
71+
<li class="toctree-l1"><a class="reference internal" href="../../../api/summarize.html">pythainlp.summarize</a></li>
72+
<li class="toctree-l1"><a class="reference internal" href="../../../api/tag.html">pythainlp.tag</a></li>
73+
<li class="toctree-l1"><a class="reference internal" href="../../../api/tokenize.html">pythainlp.tokenize</a></li>
74+
<li class="toctree-l1"><a class="reference internal" href="../../../api/tools.html">pythainlp.tools</a></li>
75+
<li class="toctree-l1"><a class="reference internal" href="../../../api/translate.html">pythainlp.translate</a></li>
76+
<li class="toctree-l1"><a class="reference internal" href="../../../api/transliterate.html">pythainlp.transliterate</a></li>
77+
<li class="toctree-l1"><a class="reference internal" href="../../../api/ulmfit.html">pythainlp.ulmfit</a></li>
78+
<li class="toctree-l1"><a class="reference internal" href="../../../api/util.html">pythainlp.util</a></li>
79+
<li class="toctree-l1"><a class="reference internal" href="../../../api/wangchanberta.html">pythainlp.wangchanberta</a></li>
80+
<li class="toctree-l1"><a class="reference internal" href="../../../api/word_vector.html">pythainlp.word_vector</a></li>
81+
<li class="toctree-l1"><a class="reference internal" href="../../../api/wsd.html">pythainlp.wsd</a></li>
82+
</ul>
83+
84+
</div>
85+
</div>
86+
</nav>
87+
88+
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
89+
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
90+
<a href="../../../index.html">PyThaiNLP</a>
91+
</nav>
92+
93+
<div class="wy-nav-content">
94+
<div class="rst-content">
95+
<div role="navigation" aria-label="Page navigation">
96+
<ul class="wy-breadcrumbs">
97+
<li><a href="../../../index.html" class="icon icon-home" aria-label="Home"></a></li>
98+
<li class="breadcrumb-item"><a href="../../index.html">Module code</a></li>
99+
<li class="breadcrumb-item active">pythainlp.ancient.currency</li>
100+
<li class="wy-breadcrumbs-aside">
101+
</li>
102+
</ul>
103+
<hr/>
104+
</div>
105+
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
106+
<div itemprop="articleBody">
107+
108+
<h1>Source code for pythainlp.ancient.currency</h1><div class="highlight"><pre>
109+
<span></span><span class="c1"># -*- coding: utf-8 -*-</span>
110+
<span class="c1"># SPDX-FileCopyrightText: 2016-2025 PyThaiNLP Project</span>
111+
<span class="c1"># SPDX-FileType: SOURCE</span>
112+
<span class="c1"># SPDX-License-Identifier: Apache-2.0</span>
113+
114+
<div class="viewcode-block" id="convert_currency">
115+
<a class="viewcode-back" href="../../../api/ancient.html#pythainlp.ancient.convert_currency">[docs]</a>
116+
<span class="k">def</span><span class="w"> </span><span class="nf">convert_currency</span><span class="p">(</span><span class="n">value</span><span class="p">:</span> <span class="nb">float</span><span class="p">,</span> <span class="n">from_unit</span><span class="p">:</span> <span class="nb">str</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">dict</span><span class="p">:</span>
117+
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
118+
<span class="sd"> Convert ancient Thai currency to other units</span>
119+
120+
<span class="sd"> * เบี้ย (Bia)</span>
121+
<span class="sd"> * อัฐ (At)</span>
122+
<span class="sd"> * ไพ (Pi)</span>
123+
<span class="sd"> * เฟื้อง (Feuang)</span>
124+
<span class="sd"> * สลึง (Saleung)</span>
125+
<span class="sd"> * บาท (Bath)</span>
126+
<span class="sd"> * ตำลึง (Tamleung)</span>
127+
<span class="sd"> * ชั่ง (Chang)</span>
128+
129+
<span class="sd"> See more:</span>
130+
<span class="sd"> `Thai money &lt;https://en.wikipedia.org/wiki/History_of_Thai_money&gt;`_.</span>
131+
132+
<span class="sd"> :param float value: value</span>
133+
<span class="sd"> :param str from_unit: currency unit \</span>
134+
<span class="sd"> (&#39;เบี้ย&#39;, &#39;อัฐ&#39;, &#39;ไพ&#39;, &#39;เฟื้อง&#39;, &#39;สลึง&#39;, &#39;บาท&#39;, &#39;ตำลึง&#39;, &#39;ชั่ง&#39;)</span>
135+
<span class="sd"> :return: Thai currency</span>
136+
<span class="sd"> :rtype: dict</span>
137+
138+
<span class="sd"> :Example:</span>
139+
<span class="sd"> ::</span>
140+
141+
<span class="sd"> from pythainlp.ancient import convert_currency</span>
142+
143+
<span class="sd"> print(convert_currency(8, &quot;บาท&quot;))</span>
144+
<span class="sd"> # output:</span>
145+
<span class="sd"> # {</span>
146+
<span class="sd"> # &#39;เบี้ย&#39;: 51200.0,</span>
147+
<span class="sd"> # &#39;อัฐ&#39;: 512.0,</span>
148+
<span class="sd"> # &#39;ไพ&#39;: 256.0,</span>
149+
<span class="sd"> # &#39;เฟื้อง&#39;: 64.0,</span>
150+
<span class="sd"> # &#39;สลึง&#39;: 32.0,</span>
151+
<span class="sd"> # &#39;บาท&#39;: 8.0,</span>
152+
<span class="sd"> # &#39;ตำลึง&#39;: 2.0,</span>
153+
<span class="sd"> # &#39;ชั่ง&#39;: 0.1</span>
154+
<span class="sd"> # }</span>
155+
<span class="sd"> &quot;&quot;&quot;</span>
156+
<span class="n">conversion_factors_to_att</span> <span class="o">=</span> <span class="p">{</span>
157+
<span class="s1">&#39;เบี้ย&#39;</span><span class="p">:</span> <span class="mi">1</span><span class="p">,</span>
158+
<span class="s1">&#39;อัฐ&#39;</span><span class="p">:</span> <span class="mi">100</span><span class="p">,</span> <span class="c1"># 1 อัฐ = 100 เบี้ย</span>
159+
<span class="s1">&#39;ไพ&#39;</span><span class="p">:</span> <span class="mi">2</span> <span class="o">*</span> <span class="mi">100</span><span class="p">,</span> <span class="c1"># 1 ไพ = 2 อัฐ</span>
160+
<span class="s1">&#39;เฟื้อง&#39;</span><span class="p">:</span> <span class="mi">4</span> <span class="o">*</span> <span class="mi">2</span> <span class="o">*</span> <span class="mi">100</span><span class="p">,</span> <span class="c1"># 1 เฟื้อง = 4 ไพ</span>
161+
<span class="s1">&#39;สลึง&#39;</span><span class="p">:</span> <span class="mi">2</span> <span class="o">*</span> <span class="mi">4</span> <span class="o">*</span> <span class="mi">2</span> <span class="o">*</span> <span class="mi">100</span><span class="p">,</span> <span class="c1"># 1 สลึง = 2 เฟื้อง</span>
162+
<span class="s1">&#39;บาท&#39;</span><span class="p">:</span> <span class="mi">4</span> <span class="o">*</span> <span class="mi">2</span> <span class="o">*</span> <span class="mi">4</span> <span class="o">*</span> <span class="mi">2</span> <span class="o">*</span> <span class="mi">100</span><span class="p">,</span> <span class="c1"># 1 บาท = 4 สลึง</span>
163+
<span class="s1">&#39;ตำลึง&#39;</span><span class="p">:</span> <span class="mi">4</span> <span class="o">*</span> <span class="mi">4</span> <span class="o">*</span> <span class="mi">2</span> <span class="o">*</span> <span class="mi">4</span> <span class="o">*</span> <span class="mi">2</span> <span class="o">*</span> <span class="mi">100</span><span class="p">,</span> <span class="c1"># 1 ตำลึง = 4 บาท</span>
164+
<span class="s1">&#39;ชั่ง&#39;</span><span class="p">:</span> <span class="mi">20</span> <span class="o">*</span> <span class="mi">4</span> <span class="o">*</span> <span class="mi">4</span> <span class="o">*</span> <span class="mi">2</span> <span class="o">*</span> <span class="mi">4</span> <span class="o">*</span> <span class="mi">2</span> <span class="o">*</span> <span class="mi">100</span><span class="p">,</span> <span class="c1"># 1 ชั่ง = 20 ตำลึง</span>
165+
<span class="p">}</span>
166+
167+
<span class="k">if</span> <span class="n">from_unit</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">conversion_factors_to_att</span><span class="p">:</span>
168+
<span class="k">raise</span> <span class="ne">NotImplementedError</span><span class="p">(</span>
169+
<span class="sa">f</span><span class="s2">&quot;Currency unit &#39;</span><span class="si">{</span><span class="n">from_unit</span><span class="si">}</span><span class="s2">&#39; is not support.&quot;</span>
170+
<span class="p">)</span>
171+
172+
<span class="c1"># start from &#39;อัฐ&#39;</span>
173+
<span class="n">value_in_att</span> <span class="o">=</span> <span class="n">value</span> <span class="o">*</span> <span class="n">conversion_factors_to_att</span><span class="p">[</span><span class="n">from_unit</span><span class="p">]</span>
174+
175+
<span class="c1"># Calculate values ​​in other units</span>
176+
<span class="n">results</span> <span class="o">=</span> <span class="p">{}</span>
177+
<span class="k">for</span> <span class="n">unit</span><span class="p">,</span> <span class="n">factor</span> <span class="ow">in</span> <span class="n">conversion_factors_to_att</span><span class="o">.</span><span class="n">items</span><span class="p">():</span>
178+
<span class="n">results</span><span class="p">[</span><span class="n">unit</span><span class="p">]</span> <span class="o">=</span> <span class="n">value_in_att</span> <span class="o">/</span> <span class="n">factor</span>
179+
180+
<span class="k">return</span> <span class="n">results</span></div>
181+
182+
</pre></div>
183+
184+
</div>
185+
</div>
186+
<footer>
187+
188+
<hr/>
189+
190+
<div role="contentinfo">
191+
<p>&#169; Copyright 2017-2025, PyThaiNLP (Apache Software License 2.0).</p>
192+
</div>
193+
194+
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
195+
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
196+
provided by <a href="https://readthedocs.org">Read the Docs</a>.
197+
198+
199+
</footer>
200+
</div>
201+
</div>
202+
</section>
203+
</div>
204+
<script>
205+
jQuery(function () {
206+
SphinxRtdTheme.Navigation.enable(true);
207+
});
208+
</script>
209+
210+
</body>
211+
</html>

_modules/pythainlp/coref/core.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
<head>
66
<meta charset="utf-8" />
77
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
8-
<title>pythainlp.coref.core &mdash; PyThaiNLP 372ced4 documentation</title>
8+
<title>pythainlp.coref.core &mdash; PyThaiNLP 9a1ca86 documentation</title>
99
<link rel="stylesheet" type="text/css" href="../../../_static/pygments.css?v=03e43079" />
1010
<link rel="stylesheet" type="text/css" href="../../../_static/css/theme.css?v=e59714d7" />
1111
<link rel="stylesheet" type="text/css" href="../../../_static/style.css?v=eea1f72d" />
1212

1313

1414
<script src="../../../_static/jquery.js?v=5d32c60e"></script>
1515
<script src="../../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
16-
<script src="../../../_static/documentation_options.js?v=8c12b5f7"></script>
16+
<script src="../../../_static/documentation_options.js?v=65404f25"></script>
1717
<script src="../../../_static/doctools.js?v=9bcbadda"></script>
1818
<script src="../../../_static/sphinx_highlight.js?v=dc90522c"></script>
1919
<script src="../../../_static/js/theme.js"></script>

_modules/pythainlp/corpus/common.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
<head>
66
<meta charset="utf-8" />
77
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
8-
<title>pythainlp.corpus.common &mdash; PyThaiNLP 372ced4 documentation</title>
8+
<title>pythainlp.corpus.common &mdash; PyThaiNLP 9a1ca86 documentation</title>
99
<link rel="stylesheet" type="text/css" href="../../../_static/pygments.css?v=03e43079" />
1010
<link rel="stylesheet" type="text/css" href="../../../_static/css/theme.css?v=e59714d7" />
1111
<link rel="stylesheet" type="text/css" href="../../../_static/style.css?v=eea1f72d" />
1212

1313

1414
<script src="../../../_static/jquery.js?v=5d32c60e"></script>
1515
<script src="../../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
16-
<script src="../../../_static/documentation_options.js?v=8c12b5f7"></script>
16+
<script src="../../../_static/documentation_options.js?v=65404f25"></script>
1717
<script src="../../../_static/doctools.js?v=9bcbadda"></script>
1818
<script src="../../../_static/sphinx_highlight.js?v=dc90522c"></script>
1919
<script src="../../../_static/js/theme.js"></script>

0 commit comments

Comments
 (0)