关于 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)

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

发布了291 篇原创文章 · 获赞 104 · 访问量 41万+

猜你喜欢

转载自blog.csdn.net/Enjolras_fuu/article/details/105194574