コード例 #1
0
 def test_drop_apostrophe(self):
     self.assertEqual(trans.pinyin_to_zhuyin("xi1'an1"), "ㄒㄧ ㄢ")
     self.assertEqual(trans.pinyin_to_ipa("xi1'an1"), "ɕi˥ an˥")
     self.assertEqual(trans.to_pinyin("xi1'an1"), "xī'ān")
     self.assertEqual(trans.pinyin_to_zhuyin("xī'ān"), "ㄒㄧ ㄢ")
     self.assertEqual(trans.pinyin_to_ipa("xī'ān"), "ɕi˥ an˥")
     self.assertEqual(trans.to_pinyin("xī'ān", accented=False), "xi1'an1")
コード例 #2
0
 def test_drop_apostrophe(self):
     self.assertEqual(trans.pinyin_to_zhuyin("xi1'an1"), 'ㄒㄧ ㄢ')
     self.assertEqual(trans.pinyin_to_ipa("xi1'an1"), 'ɕi˥ an˥')
     self.assertEqual(trans.to_pinyin("xi1'an1"), "xī'ān")
     self.assertEqual(trans.pinyin_to_zhuyin("xī'ān"), 'ㄒㄧ ㄢ')
     self.assertEqual(trans.pinyin_to_ipa("xī'ān"), 'ɕi˥ an˥')
     self.assertEqual(trans.to_pinyin("xī'ān", accented=False), "xi1'an1")
コード例 #3
0
 def test_pinyin_middle_dot(self):
     self.assertEqual(trans.to_pinyin("\u00B7zi", accented=False), "zi5")
コード例 #4
0
 def test_accented_to_numbered(self):
     numbered_pinyin = trans.to_pinyin(self.accented_pinyin, accented=False)
     self.assertEqual(numbered_pinyin, self.numbered_pinyin)
コード例 #5
0
 def test_numbered_to_accented(self):
     accented_pinyin = trans.to_pinyin(self.numbered_pinyin)
     self.assertEqual(accented_pinyin, self.accented_pinyin)
コード例 #6
0
 def test_handle_middle_dot(self):
     self.assertEqual(trans.to_pinyin("ān\u00B7jing", accented=False), "an1jing5")
コード例 #7
0
 def test_pinyin_r_suffix(self):
     self.assertEqual(trans.to_pinyin("hua1r5"), "hu\u0101r")
     self.assertEqual(trans.to_pinyin("hu\u0101r", accented=False), "hua1r5")
コード例 #8
0
 def test_pinyin_r_suffix(self):
     self.assertEqual(trans.to_pinyin('hua1r5'), 'hu\u0101r')
     self.assertEqual(trans.to_pinyin('hu\u0101r', accented=False),
                      'hua1r5')
コード例 #9
0
 def test_pinyin_middle_dot(self):
     self.assertEqual(trans.to_pinyin('\u00B7zi', accented=False), 'zi5')
コード例 #10
0
 def test_accented_to_numbered(self):
     numbered_pinyin = trans.to_pinyin(self.accented_pinyin, accented=False)
     self.assertEqual(numbered_pinyin, self.numbered_pinyin)
コード例 #11
0
 def test_numbered_to_accented(self):
     accented_pinyin = trans.to_pinyin(self.numbered_pinyin)
     self.assertEqual(accented_pinyin, self.accented_pinyin)
コード例 #12
0
 def test_handle_middle_dot(self):
     self.assertEqual(trans.to_pinyin('ān\u00B7jing', accented=False),
                      'an1jing5')
コード例 #13
0
 def test_pinyin_r_suffix(self):
     self.assertEqual(trans.to_pinyin('hua1r5'), 'hu\u0101r')
     self.assertEqual(trans.to_pinyin('hu\u0101r', accented=False),
                      'hua1r5')
コード例 #14
0
 def test_pinyin_middle_dot(self):
     self.assertEqual(trans.to_pinyin('\u00B7zi', accented=False), 'zi5')