Skip to content

Commit cd12517

Browse files
committed
Formatting
1 parent 9998c3b commit cd12517

12 files changed

Lines changed: 14 additions & 22 deletions

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ classifiers = [
5050
"Programming Language :: Python :: 3.11",
5151
"Programming Language :: Python :: 3.12",
5252
"Programming Language :: Python :: 3.13",
53+
"Programming Language :: Python :: 3.14",
5354
"Intended Audience :: Developers",
5455
"Natural Language :: Thai",
5556
"Topic :: Scientific/Engineering :: Artificial Intelligence",
@@ -185,6 +186,7 @@ extra = [
185186
"pandas>=0.24",
186187
"ssg>=0.0.8",
187188
"symspellpy>=6.7.6",
189+
"tltk>=1.10",
188190
]
189191

190192
# Full dependencies - pinned where available

tests/compact/testc_util.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
# SPDX-FileType: SOURCE
33
# SPDX-License-Identifier: Apache-2.0
44

5-
"""Unit tests for pythainlp.util module.
6-
"""
5+
"""Unit tests for pythainlp.util module."""
76

87
import unittest
98

tests/core/test_robustness.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,4 +253,3 @@ def test_word_tokenize_with_very_long_strings(self):
253253
f"word_tokenize (engine={engine}) failed with "
254254
f"very long string (index={i}): {e}"
255255
)
256-

tests/core/test_tag.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ def test_NER_error_handling(self):
9494
with self.assertRaises(ValueError):
9595
NER(engine="thainer", corpus="cat")
9696

97+
9798
class PerceptronTaggerTestCase(unittest.TestCase):
9899
"""Test pythainlp.tag.PerceptronTagger
99100
@@ -202,6 +203,7 @@ def test_perceptron_tagger_custom(self):
202203
with self.assertRaises(IOError):
203204
tagger.load("ptagger_notexistX4AcOcX.pkl") # file does not exist
204205

206+
205207
class TagLocationsTestCase(unittest.TestCase):
206208
"""Test pythainlp.tag.locations"""
207209

tests/extra/testx_augment.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ def setUp(self):
2222
self.text2 = "เราอยู่ที่มหาวิทยาลัยขอนแก่น"
2323

2424
def test_WordNetAug(self):
25-
nltk.download('omw-1.4', force=True) # load wordnet
25+
nltk.download("omw-1.4", force=True) # load wordnet
2626
wordnetaug = WordNetAug()
2727
self.assertIsNotNone(wordnetaug.augment(self.text))
2828
self.assertIsNotNone(wordnetaug.find_synonyms("ผม", pos=None))
2929
self.assertIsNotNone(wordnetaug.augment(self.text, postag=False))
30-
self.assertIsNone(postype2wordnet('n', 'abc'))
31-
self.assertIsNotNone(postype2wordnet('NOUN', 'orchid'))
30+
self.assertIsNone(postype2wordnet("n", "abc"))
31+
self.assertIsNotNone(postype2wordnet("NOUN", "orchid"))
3232

3333
# def test_Thai2fitAug(self):
3434
# _aug = Thai2fitAug()

tests/extra/testx_spell.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
# SPDX-License-Identifier: Apache-2.0
44

55
# Tests for spell functions that need extra dependencies
6-
# Note: Tests requiring phunspell/torch/HuggingFace Hub have been moved to tests.noauto
76

87
import unittest
98

@@ -20,7 +19,6 @@
2019

2120
class SpellTestCaseX(unittest.TestCase):
2221
def test_spell(self):
23-
# Tests for symspellpy only (phunspell moved to noauto)
2422
result = spell("เน้ร", engine="symspellpy")
2523
self.assertIsInstance(result, list)
2624
self.assertGreater(len(result), 0)
@@ -30,17 +28,14 @@ def test_spell(self):
3028
self.assertGreater(len(result), 0)
3129

3230
def test_word_correct(self):
33-
# Tests for symspellpy only (phunspell and wanchanberta moved to noauto)
3431
result = correct("ทดสอง", engine="symspellpy")
3532
self.assertIsInstance(result, str)
3633
self.assertNotEqual(result, "")
3734

3835
def test_spell_sent(self):
39-
# Tests for symspellpy only (phunspell moved to noauto)
4036
self.assertIsNotNone(spell_sent(SENT_TOKS, engine="symspellpy"))
4137

4238
def test_correct_sent(self):
43-
# Tests for symspellpy only (phunspell and wanchanberta moved to noauto)
4439
self.assertIsNotNone(correct_sent(SENT_TOKS, engine="symspellpy"))
4540
self.assertIsNotNone(symspellpy.correct_sent(SENT_TOKS))
4641

@@ -56,4 +51,3 @@ def test_spell_tltk(self):
5651
result = spell("เดก", engine="tltk")
5752
self.assertIsInstance(result, list)
5853
self.assertGreater(len(result), 0)
59-

tests/extra/testx_tag.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
# SPDX-License-Identifier: Apache-2.0
44

55
# Tests for tag functions that need extra dependencies
6-
# Note: Tests requiring transformers have been moved to tests.noauto
76

87
import unittest
98

@@ -12,7 +11,6 @@
1211

1312

1413
class TagTestCaseX(unittest.TestCase):
15-
# Tests for ThaiNameTagger (doesn't require transformers)
1614

1715
def test_thai_name_tagger_1_5(self):
1816
ner = ThaiNameTagger(version="1.5")
@@ -153,4 +151,3 @@ def test_tltk_ner(self):
153151
tag=True,
154152
)
155153
)
156-

tests/extra/testx_tokenize.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
# SPDX-License-Identifier: Apache-2.0
44

55
# Tests for tokenize functions that need extra dependencies
6-
# Note: Tests requiring TensorFlow/Keras/torch/transformers have been moved to tests.noauto
76

87
import unittest
98

@@ -145,5 +144,3 @@ class WordTokenizeTLTKTestCaseX(unittest.TestCase):
145144

146145
def test_word_tokenize_tltk(self):
147146
self.assertIsNotNone(word_tokenize(TEXT_1, engine="tltk"))
148-
149-

tests/extra/testx_translate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def test_translate(self):
7171
# )
7272
# )
7373
with self.assertRaises(ValueError):
74-
self.th_cat_translator = Translate('th', 'cat', engine="fkfj")
74+
self.th_cat_translator = Translate("th", "cat", engine="fkfj")
7575

7676
def test_word_translate(self):
7777
self.assertIsNone(word_translate("cat", src="en", target="th"))

tests/extra/testx_util.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
# SPDX-FileType: SOURCE
33
# SPDX-License-Identifier: Apache-2.0
44

5-
"""Unit tests for pythainlp.util module.
6-
"""
5+
"""Unit tests for pythainlp.util module."""
76

87
import unittest
98

0 commit comments

Comments
 (0)