How to use the pykakasi.J2H 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
def test_J2H(self):

        TESTS = [
            ("構成",         ("こうせい",2)),
            ("好き",         ("すき",2)),
            ("大きい",       ("おおきい",3)),
            ("日本国民は、", ("にほんこくみん", 4))
      ]

        I_TEST = [
            ("菟", "兎"),
            ("菟集", "兎集"),
            ("熙", "煕"),
        ]

        j = pykakasi.J2H()
        for case, result in TESTS:
            self.assertEqual(j.convert(case), result)
        for case, result in I_TEST:
            self.assertEqual(j.itaiji_conv(case), result)