How to use the pykakasi.J2a 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_J2a_kunrei(self):

        TESTS = [
            ("構成",         ("kousei",2)),
            ("好き",         ("suki",2)),
            ("大きい",       ("ookii",3)),
            ("日本国民は、", ("nihonkokumin", 4)),
            ("漢字",         ("kanzi",2))
      ]

        j = pykakasi.J2a(method="Kunrei")
        for case, result in TESTS:
            self.assertEqual(j.convert(case), result)
github miurahr / pykakasi / tests / basic_3.py View on Github external
def test_J2a(self):

        TESTS = [
            ("構成",         ("kousei",2)),
            ("好き",         ("suki",2)),
            ("大きい",       ("ookii",3)),
            ("日本国民は、", ("nihonkokumin", 4))
      ]

        j = pykakasi.J2a()
        for case, result in TESTS:
            self.assertEqual(j.convert(case), result)
github miurahr / pykakasi / tests / basic_3.py View on Github external
def test_J2a_passport(self):

        TESTS = [
            ("構成",         ("kosei",2)),
            ("好き",         ("suki",2)),
            ("大きい",       ("okii",3)),
            ("日本国民は、", ("nihonkokumin", 4)),
            ("漢字",         ("kanji", 2)),
            ("佐藤",         ("sato", 2)),
            ("難波",         ("namba",2))
      ]

        j = pykakasi.J2a(method="Passport")
        for case, result in TESTS:
            self.assertEqual(j.convert(case), result)