Example #1
0
 def test_parse_numbered_pinyin_6(self):
     pinyin_tuples = zl.parse_cedict_pinyin(u'[xx5 guan3]')
     self.assertEqual(None, pinyin_tuples[0])
     self.assertEqual((u'guan', 3), pinyin_tuples[1])
Example #2
0
 def test_parse_numbered_pinyin_1(self):
     pinyin_tuples = zl.parse_cedict_pinyin(u'[tang1]')
     self.assertEqual((u'tang', 1), pinyin_tuples[0])
Example #3
0
 def test_parse_numbered_pinyin_6(self):
     pinyin_tuples = zl.parse_cedict_pinyin(u'[xx5]')
     self.assertEqual(None, pinyin_tuples[0])
Example #4
0
 def test_parse_numbered_pinyin_5(self):
     pinyin_tuples = zl.parse_cedict_pinyin(u'[lU:3 guan3]')
     self.assertEqual((u'lÜ', 3), pinyin_tuples[0])
     self.assertEqual((u'guan', 3), pinyin_tuples[1])
Example #5
0
 def test_parse_numbered_pinyin_3(self):
     pinyin_tuples = zl.parse_cedict_pinyin(u'[hen1 hao5]')
     self.assertEqual((u'hen', 1), pinyin_tuples[0])
     self.assertEqual((u'hao', 0), pinyin_tuples[1])
Example #6
0
 def test_bug_1(self):
     tuples = zl.parse_cedict_pinyin('[pang2 bian1 r5]')
     formatted = zl.format_pinyin_sequence(tuples)
     self.assertEqual(formatted, u'pángbiānr')
Example #7
0
 def test_parse_numbered_pinyin_2(self):
     pinyin_tuples = zl.parse_cedict_pinyin(u'[hen3 hao4]')
     self.assertEqual((u'hen', 3), pinyin_tuples[0])
     self.assertEqual((u'hao', 4), pinyin_tuples[1])