`

python获取简拼全拼模块(修正版)

 
阅读更多

https://github.com/cleverdeng/

这个位置获取到的,修正了非汉字会导致出错的问提。

 用法很简单:

if __name__ == "__main__":

    test = PinYin()

    words = "test==<>《dia\"钓鱼到\"》"

    arr = test.getpinyin(words)

    jp = arr[0]

    qp = arr[1]

    print "文字:%s 简拼:%s 全拼:%s" %(words, jp, qp) 

 

修正明细:

1.修正某些情况会出错崩溃的问题。

2.修正英文、等号直接输出的问题。

3.直接输出全拼、简拼

4.修正“叶”被解析成不太常用的xie读音的问题。替换了word.data。

 

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics