Exemplo n.º 1
0
    def test_J2a(self):

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

        j = pykakasi.J2a()
        for case, result in TESTS:
            self.assertEqual(j.convert(case), result)
Exemplo n.º 2
0
    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)
Exemplo n.º 3
0
    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)