Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_K2a(self):
TESTS = [
("カンタン", ("ka", 1)),
("ニャ", ("nya",2)),
("ッキ", ("kki",2)),
("ッファ", ("ffa", 3)),
("シツモン", ("shi", 1)),
("チガイ", ("chi", 1)),
("ジ", ("ji",1)),
]
h = pykakasi.K2a()
for case, result in TESTS:
self.assertEqual(h.convert(case), result)
("ジー", ("zi", 1)),
("ウォークマン", ("u", 1)),
("キャ", ("kya", 2)), ("キュ", ("kyu", 2)), ("キョ", ("kyo", 2)),
("シャ", ("sya", 2)), ("シュ", ("syu", 2)), ("ショ", ("syo", 2)),
("チャ", ("tya", 2)), ("チュ", ("tyu", 2)), ("チョ", ("tyo", 2)),
("ニャ", ("nya", 2)), ("ニュ", ("nyu", 2)), ("ニョ", ("nyo", 2)),
("リャ", ("rya", 2)), ("リュ", ("ryu", 2)), ("リョ", ("ryo", 2)),
("ザ", ("za", 1)), ("ジ", ("zi", 1)), ("ズ", ("zu", 1)),
("ゼ", ("ze", 1)), ("ゾ", ("zo", 1)),
("ダ", ("da", 1)), ("ヂ", ("zi", 1)), ("ヅ", ("zu", 1)),
("デ", ("de", 1)), ("ド", ("do", 1)),
("タ", ("ta", 1)), ("チ", ("ti", 1)), ("ツ", ("tu", 1)),
("テ", ("te", 1)), ("ト", ("to", 1))
]
h = pykakasi.K2a(method="Kunrei")
for case, result in TESTS:
self.assertEqual(h.convert(case), result)