利用opencc实现汉字的简繁转换

# 安装
# 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)
最后修改:2023 年 12 月 05 日
如果觉得我的文章对你有用,请随意赞赏