Skip to content

Commit 029ef4b

Browse files
committed
Add tests.compact.transliterate
1 parent ed83a18 commit 029ef4b

10 files changed

+27
-1
lines changed

tests/compact/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"tests.compact.testc_parse",
1515
"tests.compact.testc_tokenize",
1616
"tests.compact.testc_tools",
17+
"tests.compact.testc_transliterate",
1718
"tests.compact.testc_util",
1819
]
1920

tests/compact/testc_tools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def _count_difference(st1: str, st2: str) -> int:
2020
return count
2121

2222

23-
class MisspellTestCaseX(unittest.TestCase):
23+
class MisspellTestCase(unittest.TestCase):
2424
def setUp(self):
2525
self.texts = ["เรารักคุณมากที่สุดในโลก", "เราอยู่ที่มหาวิทยาลัยขอนแก่น"]
2626

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# -*- coding: utf-8 -*-
2+
# SPDX-FileCopyrightText: 2016-2024 PyThaiNLP Project
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
import unittest
6+
7+
from pythainlp.transliterate import transliterate
8+
9+
10+
class TransliterateICUTestCase(unittest.TestCase):
11+
def test_transliterate(self):
12+
self.assertEqual(transliterate("แมว", "pyicu"), "mæw")

tests/core/test_ancient.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# -*- coding: utf-8 -*-
22
# SPDX-FileCopyrightText: 2016-2024 PyThaiNLP Project
33
# SPDX-License-Identifier: Apache-2.0
4+
45
import unittest
56

67
from pythainlp.ancient import aksonhan_to_current

tests/core/test_transliterate.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# -*- coding: utf-8 -*-
2+
# SPDX-FileCopyrightText: 2016-2024 PyThaiNLP Project
3+
# SPDX-License-Identifier: Apache-2.0
24

35
import unittest
46

tests/extra/testx_translate.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# -*- coding: utf-8 -*-
2+
# SPDX-FileCopyrightText: 2016-2024 PyThaiNLP Project
3+
# SPDX-License-Identifier: Apache-2.0
24

35
import unittest
46

tests/extra/testx_transliterate.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# -*- coding: utf-8 -*-
2+
# SPDX-FileCopyrightText: 2016-2024 PyThaiNLP Project
3+
# SPDX-License-Identifier: Apache-2.0
24

35
import unittest
46

tests/extra/testx_ulmfit.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# -*- coding: utf-8 -*-
2+
# SPDX-FileCopyrightText: 2016-2024 PyThaiNLP Project
3+
# SPDX-License-Identifier: Apache-2.0
24

35
import pickle
46
import unittest

tests/extra/testx_wangchanberta.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# -*- coding: utf-8 -*-
2+
# SPDX-FileCopyrightText: 2016-2024 PyThaiNLP Project
3+
# SPDX-License-Identifier: Apache-2.0
24

35
import unittest
46

tests/extra/testx_word_vector.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# -*- coding: utf-8 -*-
2+
# SPDX-FileCopyrightText: 2016-2024 PyThaiNLP Project
3+
# SPDX-License-Identifier: Apache-2.0
24

35
import unittest
46

0 commit comments

Comments
 (0)