python繁简体转换【亲测有效】
背景:工作中需要将一些繁体字转成简体字,发现python的opencc-python模块可以做到,做下笔记,希望能帮助有同样问题的旁友~ 模块简介:OpenCC-Python是一个致力于中文简繁转换的项目,提供高质量词库和函数库(libopencc)。 (1) 安装: pip install opencc-python-reimplemented (2) 主要函数: • t2s – 繁体转简体 • s2t – 简体转繁体 • mix2t – 混合转繁体 • mix2s – 混合转简体 (3) 使用示例: import opencc cc = opencc.OpenCC('t2s') s = c
下载地址
用户评论