|
15 | 15 | tone, |
16 | 16 | wordnet, |
17 | 17 | ) |
18 | | -from pythainlp.date import now, reign_year_to_ad |
| 18 | +from pythainlp.date import now, reign_year_to_ad, now_reign_year |
19 | 19 | from pythainlp.keywords import find_keyword |
20 | 20 | from pythainlp.MetaSound import MetaSound |
21 | 21 | from pythainlp.ner import ThaiNameRecognizer |
|
28 | 28 | from pythainlp.tag import pos_tag, pos_tag_sents |
29 | 29 | from pythainlp.tokenize import etcc, isthai, syllable_tokenize, tcc, word_tokenize |
30 | 30 | from pythainlp.util import listtext_num2num, normalize |
31 | | - |
| 31 | +from pythainlp.Text import Text |
32 | 32 |
|
33 | 33 | class TestUM(unittest.TestCase): |
34 | 34 | """ |
@@ -152,6 +152,10 @@ def test_spell(self): |
152 | 152 | def test_date(self): |
153 | 153 | self.assertIsNotNone(now()) |
154 | 154 | 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()) |
155 | 159 |
|
156 | 160 | def test_summarize(self): |
157 | 161 | text = "อาหาร หมายถึง ของแข็งหรือของเหลว " |
@@ -242,7 +246,8 @@ def test_ner(self): |
242 | 246 | ("เช้า", "I-TIME"), |
243 | 247 | ], |
244 | 248 | ) |
245 | | - |
| 249 | + def test_Text(self): |
| 250 | + self.assertIsNotNone(Text("ทดสอบภาษาไทย")) |
246 | 251 |
|
247 | 252 | if __name__ == "__main__": |
248 | 253 | unittest.main() |
0 commit comments