Skip to content

Commit f0d6d71

Browse files
authored
Merge pull request #1025 from PyThaiNLP/5.0.4
PyThaiNLP v5.0.4
2 parents c41633e + 5971300 commit f0d6d71

File tree

9 files changed

+20
-12
lines changed

9 files changed

+20
-12
lines changed

CITATION.cff

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cff-version: 1.1.0
1+
cff-version: "1.2.0"
22
message: "If you use this software, please cite it as below."
33
authors:
44
- family-names: "Phatthiyaphaibun"
@@ -20,5 +20,6 @@ authors:
2020
given-names: "Pattarawat"
2121
orcid: "https://orcid.org/0000-0000-0000-0000"
2222
title: "PyThaiNLP: Thai Natural Language Processing in Python"
23-
version: v5.0.3
24-
date-released: 2024-05-12
23+
version: v5.0.4
24+
license: Apache-2.0
25+
date-released: 2024-06-02

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ PyThaiNLP เป็นไลบารีภาษาไพทอนสำหร
2323
2424
| Version | Description | Status |
2525
|:------:|:--:|:------:|
26-
| [5.0.3](https://github.com/PyThaiNLP/pythainlp/releases) | Stable | [Change Log](https://github.com/PyThaiNLP/pythainlp/issues/788) |
26+
| [5.0.4](https://github.com/PyThaiNLP/pythainlp/releases) | Stable | [Change Log](https://github.com/PyThaiNLP/pythainlp/issues/788) |
2727
| [`dev`](https://github.com/PyThaiNLP/pythainlp/tree/dev) | Release Candidate for 5.1 | [Change Log](https://github.com/PyThaiNLP/pythainlp/issues/900) |
2828

2929
## Getting Started

README_TH.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ PyThaiNLP เป็นไลบารีภาษาไพทอนสำหร
2020
2121
| รุ่น | คำอธิบาย | สถานะ |
2222
|:------:|:--:|:------:|
23-
| [5.0.3](https://github.com/PyThaiNLP/pythainlp/releases) | Stable | [Change Log](https://github.com/PyThaiNLP/pythainlp/issues/788) |
23+
| [5.0.4](https://github.com/PyThaiNLP/pythainlp/releases) | Stable | [Change Log](https://github.com/PyThaiNLP/pythainlp/issues/788) |
2424
| [`dev`](https://github.com/PyThaiNLP/pythainlp/tree/dev) | Release Candidate for 5.1 | [Change Log](https://github.com/PyThaiNLP/pythainlp/issues/900) |
2525

2626
ติดตามพวกเราบน [PyThaiNLP Facebook page](https://www.facebook.com/pythainlp/) เพื่อรับข่าวสารเพิ่มเติม

pythainlp/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# -*- coding: utf-8 -*-
22
# SPDX-FileCopyrightText: 2016-2024 PyThaiNLP Project
33
# SPDX-License-Identifier: Apache-2.0
4-
__version__ = "5.0.3"
4+
__version__ = "5.0.4"
55

66
thai_consonants = "กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรลวศษสหฬอฮ" # 44 chars
77

pythainlp/tag/thainer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class ThaiNameTagger:
8383
:Example:
8484
::
8585
86-
from pythainlp.tag.named_entity import ThaiNameTagger
86+
from pythainlp.tag.thainer import ThaiNameTagger
8787
8888
thainer14 = ThaiNameTagger(version="1.4")
8989
thainer14.get_ner("วันที่ 15 ก.ย. 61 ทดสอบระบบเวลา 14:49 น.")
@@ -133,7 +133,7 @@ def get_ner(
133133
134134
:Example:
135135
136-
>>> from pythainlp.tag.named_entity import ThaiNameTagger
136+
>>> from pythainlp.tag.thainer import ThaiNameTagger
137137
>>>
138138
>>> ner = ThaiNameTagger()
139139
>>> ner.get_ner("วันที่ 15 ก.ย. 61 ทดสอบระบบเวลา 14:49 น.")

pythainlp/util/normalize.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,9 +283,12 @@ def maiyamok(sent: Union[str, List[str]]) -> List[str]:
283283
if "ๆ" == text:
284284
text = _list_word[i - 1]
285285
elif "ๆ" in text:
286-
text = text.replace("ๆ", "")
287-
_list_word.append(text)
286+
count = text.count("ๆ")
287+
text = _list_word[i - 1]
288+
for _ in range(count):
289+
_list_word.append(text)
288290
i += 1
291+
continue
289292
_list_word.append(text)
290293
i += 1
291294
return _list_word

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 5.0.3
2+
current_version = 5.0.4
33
commit = True
44
tag = True
55
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\-(?P<release>[a-z]+)(?P<build>\d+))?

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@
161161

162162
setup(
163163
name="pythainlp",
164-
version="5.0.3",
164+
version="5.0.4",
165165
description="Thai Natural Language Processing library",
166166
long_description=readme,
167167
long_description_content_type="text/markdown",

tests/test_util.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,10 @@ def test_normalize(self):
531531
maiyamok("เด็กๆชอบไปโรงเรียน"),
532532
["เด็ก", "เด็ก", "ชอบ", "ไป", "โรงเรียน"],
533533
)
534+
self.assertEqual(
535+
maiyamok("เด็กๆๆชอบไปโรงเรียน"),
536+
['เด็ก', 'เด็ก', 'เด็ก', 'ชอบ', 'ไป', 'โรงเรียน'],
537+
) # 914
534538
self.assertEqual(
535539
maiyamok(
536540
["ทำไม", "คน", "ดี", " ", "ๆ", "ๆ", " ", "ถึง", "ทำ", "ไม่ได้"]

0 commit comments

Comments
 (0)