Skip to content

Commit 7b18822

Browse files
committed
more test case
1 parent 7b3d077 commit 7b18822

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

pythainlp/rank/__init__.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@ def rank(words, stopword=False):
1818
if stopword:
1919
words = [word for word in words if word not in _STOPWORDS]
2020

21-
rankdata = Counter(words)
22-
23-
return rankdata
21+
return Counter(words)
2422

2523

2624
if __name__ == "__main__":

tests/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ def test_romanization(self):
216216

217217
def test_romanization_royin(self):
218218
engine = "royin"
219-
self.assertIsNone(romanize("กก", engine=engine))
219+
self.assertIsNotNone(romanize("กก", engine=engine))
220220
self.assertEqual(romanize("แมว", engine=engine), "maeo")
221221
self.assertEqual(romanize("เดือน", engine=engine), "duean")
222222
self.assertEqual(romanize("ดู", engine=engine), "du")
@@ -352,6 +352,7 @@ def test_deletetone(self):
352352

353353
def test_is_thai(self):
354354
self.assertEqual(is_thai("ประเทศไทย"), {"thai": 100.0})
355+
self.assertIsNotNone(is_thai("เผือก", check_all=True))
355356

356357
def test_is_thaichar(self):
357358
self.assertEqual(is_thaichar("ก"), True)

0 commit comments

Comments
 (0)