How to use the pykakasi.H2a function in pykakasi

To help you get started, we’ve selected a few pykakasi examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github miurahr / pykakasi / tests / basic_3.py View on Github external
("しつもん",   ("si",1)),
            ("ちがい", ("ti",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.H2a(method="Kunrei")
        for case, result in TESTS:
            self.assertEqual(h.convert(case), result)
github miurahr / pykakasi / tests / basic_3.py View on Github external
def test_H2a_passport(self):

        TESTS = [
            ("しつもん",("shi",1)),
            ("ちがい", ("chi",1)),
            ("おおの",("o",2)),
            ("さいとう",("sa",1)),
            ("とう",("to",2)),
            ("なんば", ("na", 1)),
            ("んば", ("mba", 2))
        ]

        h = pykakasi.H2a(method="Passport")
        for case, result in TESTS:
            self.assertEqual(h.convert(case), result)
github miurahr / pykakasi / tests / basic_3.py View on Github external
def test_H2a(self):

        TESTS = [
            ("かんたん",   ("ka", 1)),
            ("にゃ", ("nya",2)),
            ("っき", ("kki",2)),
            ("っふぁ", ("ffa", 3)),
            ("しつもん",   ("shi",1)),
            ("ちがい", ("chi",1)),
        ]

        h = pykakasi.H2a()
        for case, result in TESTS:
            self.assertEqual(h.convert(case), result)