示例#1
0
	def test_hasHan(self):
			self.assertEqual(True, pinyin.hasHan(u'狗'))
			self.assertEqual(False, pinyin.hasHan(u'dog'))
示例#2
0
def abbreviation(name):
	def takeFirst(chichar):
		return chichar[0]
	if pinyin.hasHan(name) is True:
		return ''.join(list(map(_[0], pinyin.segmentation(name))))