Skip to content

Commit ad338da

Browse files
committed
Add pythainlp.Text test
- Add pythainlp.Text test
1 parent f7c177a commit ad338da

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

tests/__init__.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
tone,
1616
wordnet,
1717
)
18-
from pythainlp.date import now, reign_year_to_ad
18+
from pythainlp.date import now, reign_year_to_ad, now_reign_year
1919
from pythainlp.keywords import find_keyword
2020
from pythainlp.MetaSound import MetaSound
2121
from pythainlp.ner import ThaiNameRecognizer
@@ -28,7 +28,7 @@
2828
from pythainlp.tag import pos_tag, pos_tag_sents
2929
from pythainlp.tokenize import etcc, isthai, syllable_tokenize, tcc, word_tokenize
3030
from pythainlp.util import listtext_num2num, normalize
31-
31+
from pythainlp.Text import Text
3232

3333
class TestUM(unittest.TestCase):
3434
"""
@@ -152,6 +152,10 @@ def test_spell(self):
152152
def test_date(self):
153153
self.assertIsNotNone(now())
154154
self.assertEqual(reign_year_to_ad(2, 10), 2017)
155+
self.assertIsNotNone(reign_year_to_ad(2, 9))
156+
self.assertIsNotNone(reign_year_to_ad(2, 8))
157+
self.assertIsNotNone(reign_year_to_ad(2, 7))
158+
self.assertIsNotNone(now_reign_year())
155159

156160
def test_summarize(self):
157161
text = "อาหาร หมายถึง ของแข็งหรือของเหลว "
@@ -242,7 +246,8 @@ def test_ner(self):
242246
("เช้า", "I-TIME"),
243247
],
244248
)
245-
249+
def test_Text(self):
250+
self.assertIsNotNone(Text("ทดสอบภาษาไทย"))
246251

247252
if __name__ == "__main__":
248253
unittest.main()

0 commit comments

Comments
 (0)