def test_split_join_symmetric(self): a = [u"கப்பல்", u"வேகம்", u"உவகை"] b = list(map(lambda x: utf8.get_letters_elementary(x, True), a)) c = [] for i, b_w in enumerate(b): w = utf8.join_letters_elementary(b_w) c.append(w) d = list(map(len, b)) self.assertEqual([8, 6, 6], d) self.assertSequenceEqual(c, a)
def test_symmetric_split_join(self): from tamil.utf8 import get_letters_elementary as GLE from tamil.utf8 import join_letters_elementary origin = u'பழரதம்' symmetric = GLE(origin, True) splits = [ u'\u0baa\u0bcd', u'\u0b85', u'\u0bb4\u0bcd', u'\u0b85', u'\u0bb0\u0bcd', u'\u0b85', u'\u0ba4\u0bcd', u'\u0b85', u'\u0bae\u0bcd', None ] self.assertEqual(symmetric, splits) joined = join_letters_elementary(splits) self.assertEqual(origin, joined)
def test_symmetric_split_join(self): from tamil.utf8 import get_letters_elementary as GLE from tamil.utf8 import join_letters_elementary origin = u'பழரதம்' symmetric = GLE(origin,True) splits = [u'\u0baa\u0bcd', u'\u0b85', u'\u0bb4\u0bcd', u'\u0b85', u'\u0bb0\u0bcd', u'\u0b85', u'\u0ba4\u0bcd', u'\u0b85', u'\u0bae\u0bcd', None] self.assertEqual( symmetric, splits ) joined = join_letters_elementary(splits) self.assertEqual( origin, joined )