关于 python 的繁简体转换

原文: https://www.jianshu.com/p/64fecfad1157

# 安装
# pip install opencc-python-reimplemented

# t2s - 繁体转简体(Traditional Chinese to Simplified Chinese)
# s2t - 简体转繁体(Simplified Chinese to Traditional Chinese)
# mix2t - 混合转繁体(Mixed to Traditional Chinese)
# mix2s - 混合转简体(Mixed to Simplified Chinese)

import opencc
cc = opencc.OpenCC('t2s')
s = cc.convert('众议长与李克强会谈')
print(s)

效果:
在这里插入图片描述

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章