Skip to content

Commit 4f86929

Browse files
authored
Merge pull request #987 from bact/add-nlpo3-dep
Add nlpo3 to compact install
2 parents 74e779e + fa6ff02 commit 4f86929

File tree

7 files changed

+14
-12
lines changed

7 files changed

+14
-12
lines changed

docker_requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ fastcoref==2.1.6
1111
gensim==4.3.2
1212
h5py==3.1.0
1313
khanaa==0.0.6
14-
nlpo3==1.3.0
14+
nlpo3==1.3.1
1515
nltk==3.6.6
1616
numpy==1.22.*
1717
OSKut==1.3

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.4"
4+
__version__ = "5.0.5-dev"
55

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

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.4
2+
current_version = 5.0.5-dev
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: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
"ipa": ["epitran>=1.1"],
6868
"ml": ["numpy>=1.22", "torch>=1.0.0"],
6969
"mt5": ["sentencepiece>=0.1.91", "transformers>=4.6.0"],
70-
"nlpo3": ["nlpo3>=1.3.0"],
70+
"nlpo3": ["nlpo3>=1.3.1"],
7171
"onnx": ["numpy>=1.22", "onnxruntime>=1.10.0", "sentencepiece>=0.1.91"],
7272
"oskut": ["oskut>=1.3"],
7373
"sefr_cut": ["sefr_cut>=1.1"],
@@ -103,6 +103,7 @@
103103
# Compact dependencies, this one matches requirements.txt
104104
"compact": [
105105
"PyYAML>=5.4.1",
106+
"nlpo3>=1.3.1",
106107
"numpy>=1.22",
107108
"pyicu>=2.3",
108109
"python-crfsuite>=0.9.7",
@@ -119,7 +120,7 @@
119120
"fastcoref>=2.1.5",
120121
"gensim>=4.0.0",
121122
"khamyo>=0.2.0",
122-
"nlpo3>=1.3.0",
123+
"nlpo3>=1.3.1",
123124
"nltk>=3.3",
124125
"numpy>=1.22",
125126
"onnxruntime>=1.10.0",
@@ -148,7 +149,7 @@
148149

149150
setup(
150151
name="pythainlp",
151-
version="5.0.4",
152+
version="5.0.5-dev",
152153
description="Thai Natural Language Processing library",
153154
long_description=LONG_DESC,
154155
long_description_content_type="text/markdown",

tests/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Tests are categorized into three groups: core, compact, and extra.
1616
- Run `unittest tests.compact`
1717
- Test a limited set of functionalities that rely on a stable and small subset
1818
of optional dependencies specified in `requirements.txt`.
19-
- These dependencies are `PyYAML`, `numpy`, `pyicu`,
19+
- These dependencies are `PyYAML`, `nlpo3`, `numpy`, `pyicu`,
2020
`python-crfsuite`, and `requests`.
2121
- Test with the latest two stable Python versions.
2222

tests/compact/testc_tokenize.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,9 @@ def test_icu(self):
8888

8989
def test_word_tokenize_icu(self):
9090
self.assertIsNotNone(word_tokenize(TEXT_1, engine="icu"))
91+
92+
93+
class WordTokenizeNlpO3TestCase(unittest.TestCase):
94+
def test_word_tokenize_nlpo3(self):
95+
self.assertIsNotNone(word_tokenize(TEXT_1, engine="nlpo3"))
96+
self.assertEqual(word_tokenize("การ์", engine="nlpo3"), ["การ์"])

tests/extra/testx_tokenize.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -306,11 +306,6 @@ def test_nercut(self):
306306
self.assertIsNotNone(word_tokenize("ทดสอบ", engine="nercut"))
307307

308308

309-
class WordTokenizeNlpO3TestCase(unittest.TestCase):
310-
def test_word_tokenize_nlpo3(self):
311-
self.assertIsNotNone(word_tokenize(TEXT_1, engine="nlpo3"))
312-
313-
314309
class WordTokenizeOSKutTestCase(unittest.TestCase):
315310
def test_word_tokenize_oskut(self):
316311
self.assertIsNotNone(word_tokenize(TEXT_1, engine="oskut"))

0 commit comments

Comments
 (0)