def test_J2H(): TESTS = [(u"構成", (u"こうせい", 2)), (u"好き", (u"すき", 2)), (u"大きい", (u"おおきい", 3)), (u"日本国民は、", (u"にほんこくみん", 4))] j = pykakasi.J2("H") for case, result in TESTS: assert j.convert(case) == result
def test_J2H(self): TESTS = [(u"構成", (u"こうせい", 2)), (u"好き", (u"すき", 2)), (u"大きい", (u"おおきい", 3)), (u"日本国民は、", (u"にほんこくみん", 4))] j = pykakasi.J2("H") for case, result in TESTS: self.assertEqual(j.convert(case), result)
def test_J2K(self): TESTS = [(u"構成", (u"コウセイ", 2)), (u"好き", (u"スキ", 2)), (u"大きい", (u"オオキイ", 3)), (u"日本国民は、", (u"ニホンコクミン", 4))] j = pykakasi.J2("K") for case, result in TESTS: self.assertEqual(j.convert(case), result)
def test_itaiji(self): I_TEST = [ (u"菟", u"兎"), (u"菟集", u"兎集"), (u"熙", u"煕"), (u"壱弍", u"一二"), (u"森鷗外", u"森鴎外"), ] j = pykakasi.J2("H") for case, result in I_TEST: self.assertEqual(j.itaiji_conv(case), result)
def test_J2a(self): TESTS = [ (u"構成", ("kousei", 2)), (u"好き", ("suki", 2)), (u"大きい", ("ookii", 3)), (u"日本国民は、", ("nihonkokumin", 4)), (u"\u31a0", ("", 0)) # non japanese character ] j = pykakasi.J2("a") for case, result in TESTS: self.assertEqual(j.convert(case), result)
def test_itaiji(): I_TEST = [ (u"菟", u"兎"), (u"菟集", u"兎集"), (u"熙", u"煕"), (u"壱弍", u"一二"), (u"森鷗外", u"森鴎外"), ] j = pykakasi.J2("H") for case, result in I_TEST: assert j.itaiji_conv(case) == result
def worker_itaiji(): j = pykakasi.J2("H") for case, result in I_TEST: assert j.itaiji_conv(case) == result