Ejemplo n.º 1
0
 def test_ungrouped_pinyin(self):
     note = dict.fromkeys(['Bopomofo'], '')
     note['Reading'] = 'shen4 yun4'
     fill_bopomofo('神韻', note)
     self.assertEqual(
         note['Bopomofo'],
         '<span class="tone2">ㄕㄣˊ</span><span class="tone4">ㄩㄣˋ</span> <!-- ㄕㄣˊㄩㄣˋ -->',
     )
Ejemplo n.º 2
0
 def test_issue_79(self):
     note = {'Bopomofo': ''}
     fill_bopomofo('狭隘', note)
     self.assertEqual(
         note['Bopomofo'],
         '<span class="tone2">ㄒㄧㄚˊ</span>'
         '<span class="tone4">ㄞˋ</span> '
         '<!-- ㄒㄧㄚˊㄞˋ -->',
     )
Ejemplo n.º 3
0
 def test_ungrouped_pinyin(self):
     note = {'Bopomofo': '', 'Pinyin': 'shen4 yun4'}
     fill_bopomofo('神韻', note)
     self.assertEqual(
         note['Bopomofo'],
         '<span class="tone2">ㄕㄣˊ</span>'
         '<span class="tone4">ㄩㄣˋ</span>'
         ' <!-- ㄕㄣˊㄩㄣˋ -->',
     )
Ejemplo n.º 4
0
 def test_grouped_chars(self):
     note = dict.fromkeys(['Bopomofo'], '')
     fill_bopomofo('没有, 是 我 第一次 来 上海 旅游。', note)
     self.assertEqual(note['Bopomofo'], self.expected)