Repository Details
Shared by
HelloGitHub Rating
0 ratings
中文转拼音的 Python 库
Past 7 days Received 2 stars ✨
Use arrow keys to explore dates, Home and End for the first and last date, Escape to dismiss.| Date | Star | Daily change |
|---|---|---|
| 周二 | 5,393 | — |
| 周三 | 5,394 | +1 |
| 周四 | 5,394 | 0 |
| 周五 | 5,394 | 0 |
| 周六 | 5,394 | 0 |
| 周日 | 5,394 | 0 |
| 周一 | 5,395 | +1 |
5.4k
Stars
No
Chinese
Python
Language
Yes
Active
32
Contributors
42
Issues
No
Organization
None
Latest
632
Forks
MIT
License
汉语转拼音的 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