Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PyThaiNLP v5.0.4 #1025

Merged
merged 5 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cff-version: 1.1.0
cff-version: "1.2.0"
message: "If you use this software, please cite it as below."
authors:
- family-names: "Phatthiyaphaibun"
Expand All @@ -20,5 +20,6 @@ authors:
given-names: "Pattarawat"
orcid: "https://orcid.org/0000-0000-0000-0000"
title: "PyThaiNLP: Thai Natural Language Processing in Python"
version: v5.0.3
date-released: 2024-05-12
version: v5.0.4
license: Apache-2.0
date-released: 2024-06-02
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ PyThaiNLP เป็นไลบารีภาษาไพทอนสำหร

| Version | Description | Status |
|:------:|:--:|:------:|
| [5.0.3](https://github.com/PyThaiNLP/pythainlp/releases) | Stable | [Change Log](https://github.com/PyThaiNLP/pythainlp/issues/788) |
| [5.0.4](https://github.com/PyThaiNLP/pythainlp/releases) | Stable | [Change Log](https://github.com/PyThaiNLP/pythainlp/issues/788) |
| [`dev`](https://github.com/PyThaiNLP/pythainlp/tree/dev) | Release Candidate for 5.1 | [Change Log](https://github.com/PyThaiNLP/pythainlp/issues/900) |

## Getting Started
Expand Down
2 changes: 1 addition & 1 deletion README_TH.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ PyThaiNLP เป็นไลบารีภาษาไพทอนสำหร

| รุ่น | คำอธิบาย | สถานะ |
|:------:|:--:|:------:|
| [5.0.3](https://github.com/PyThaiNLP/pythainlp/releases) | Stable | [Change Log](https://github.com/PyThaiNLP/pythainlp/issues/788) |
| [5.0.4](https://github.com/PyThaiNLP/pythainlp/releases) | Stable | [Change Log](https://github.com/PyThaiNLP/pythainlp/issues/788) |
| [`dev`](https://github.com/PyThaiNLP/pythainlp/tree/dev) | Release Candidate for 5.1 | [Change Log](https://github.com/PyThaiNLP/pythainlp/issues/900) |

ติดตามพวกเราบน [PyThaiNLP Facebook page](https://www.facebook.com/pythainlp/) เพื่อรับข่าวสารเพิ่มเติม
Expand Down
2 changes: 1 addition & 1 deletion pythainlp/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
# SPDX-FileCopyrightText: 2016-2024 PyThaiNLP Project
# SPDX-License-Identifier: Apache-2.0
__version__ = "5.0.3"
__version__ = "5.0.4"

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

Expand Down
4 changes: 2 additions & 2 deletions pythainlp/tag/thainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class ThaiNameTagger:
:Example:
::

from pythainlp.tag.named_entity import ThaiNameTagger
from pythainlp.tag.thainer import ThaiNameTagger

thainer14 = ThaiNameTagger(version="1.4")
thainer14.get_ner("วันที่ 15 ก.ย. 61 ทดสอบระบบเวลา 14:49 น.")
Expand Down Expand Up @@ -133,7 +133,7 @@ def get_ner(

:Example:

>>> from pythainlp.tag.named_entity import ThaiNameTagger
>>> from pythainlp.tag.thainer import ThaiNameTagger
>>>
>>> ner = ThaiNameTagger()
>>> ner.get_ner("วันที่ 15 ก.ย. 61 ทดสอบระบบเวลา 14:49 น.")
Expand Down
7 changes: 5 additions & 2 deletions pythainlp/util/normalize.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,9 +283,12 @@ def maiyamok(sent: Union[str, List[str]]) -> List[str]:
if "ๆ" == text:
text = _list_word[i - 1]
elif "ๆ" in text:
text = text.replace("ๆ", "")
_list_word.append(text)
count = text.count("ๆ")
text = _list_word[i - 1]
for _ in range(count):
_list_word.append(text)
i += 1
continue
_list_word.append(text)
i += 1
return _list_word
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 5.0.3
current_version = 5.0.4
commit = True
tag = True
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\-(?P<release>[a-z]+)(?P<build>\d+))?
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@

setup(
name="pythainlp",
version="5.0.3",
version="5.0.4",
description="Thai Natural Language Processing library",
long_description=readme,
long_description_content_type="text/markdown",
Expand Down
4 changes: 4 additions & 0 deletions tests/test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,10 @@ def test_normalize(self):
maiyamok("เด็กๆชอบไปโรงเรียน"),
["เด็ก", "เด็ก", "ชอบ", "ไป", "โรงเรียน"],
)
self.assertEqual(
maiyamok("เด็กๆๆชอบไปโรงเรียน"),
['เด็ก', 'เด็ก', 'เด็ก', 'ชอบ', 'ไป', 'โรงเรียน'],
) # 914
self.assertEqual(
maiyamok(
["ทำไม", "คน", "ดี", " ", "ๆ", "ๆ", " ", "ถึง", "ทำ", "ไม่ได้"]
Expand Down
Loading