Repository Details
Shared by
HelloGitHub Rating
0 ratings
Free•MIT
Claim
Discuss
Collect
Share
4.9k
Stars
No
Chinese
Python
Language
Yes
Active
25
Contributors
31
Issues
No
Organization
0.53.0
Latest
611
Forks
MIT
License
More
汉语转拼音的 Python 库。不知道有没有小伙伴和我一样,刚看到这库不知道能用来干啥。其实它可以用来丰富被搜索的中文内容,通过该项目可实现拼音搜索内容、容错同音错别字、中文排序等,从而提高搜索准确度和体验
```python
>>> from pypinyin import pinyin, lazy_pinyin, Style
>>> pinyin('中心')
[['zhōng'], ['xīn']]
>>> pinyin('中心', heteronym=True) # 启用多音字模式
[['zhōng', 'zhòng'], ['xīn']]
>>> pinyin('中心', style=Style.TONE3, heteronym=True)
[['zhong1', 'zhong4'], ['xin1']]
```
Comments
Rating:
No comments yet