How to use the pykakasi.genkanwadict 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 / test_genkanwadict.py View on Github external
def constructor(self):
        self.kanwa = genkanwadict.mkkanwa()
        self.assertEqual(self.kanwa, object)
github miurahr / pykakasi / tests / test_genkanwadict.py View on Github external
def test_mkdict(self):
        if self.kanwa is None:
            self.kanwa = genkanwadict.mkkanwa()

        src = os.path.join('tests', 'kanadict.utf8')
        dst = os.path.join(self.tmpdir, 'test_kanadict.pickle')
        self.kanwa.mkdict(src, dst)
        # load test
        with open(dst, 'rb') as f:
            (mydict, maxkeylen) = pickle.load(f)
            f.close()
        self.assertTrue(isinstance(mydict, dict))
        self.assertEqual(maxkeylen, 3)