mozillazg / python-pinyin

汉字转拼音(pypinyin)
https://pypinyin.readthedocs.io
MIT License
4.92k stars 612 forks source link

update Related Projects. #325

Closed wolfgitpr closed 3 months ago

wolfgitpr commented 3 months ago

PR 描述

添加cpp-pinyin链接(接口参考python-pinyin,算法不同、准确率更高一些)

待办事项

测试环境

cpu i3-8100 python 3.10 pypinyin 0.52.0 cpp-pinyin tests

带声调转换测试

测试集来源——cpp_dataset,约7万9千句

pypinyin:

res = [x[0] for x in pypinyin.pinyin(raw, style=pypinyin.Style.TONE3, neutral_tone_with_five=True)]

pypinyin-tone

cpp-pinyin: cpp-pinyin-tone

无声调转换测试

测试集来源——多份歌词数据集,人工校对,约2万1千句、19万字

pypinyin:

res = [x[0] for x in pypinyin.pinyin(raw, style=pypinyin.Style.NORMAL, neutral_tone_with_five=True)]

pypinyin-unTone

cpp-pinyin: cpp-pinyin-unTone

wolfgitpr commented 3 months ago

提了个小建议。

好的,感谢指正。

wolfgitpr commented 3 months ago

已修改。