-
在做一个给汉字添加拼音的功能,但是基于现有的接口没有办法把中英混合的字mapping上。
可否提供接口实现:
``` python
lazy_pinyin(u'你好abc☆☆')
#[u'ni', u'hao', 'a', 'b', 'c', u'\u2606', u'\u2606']
```
或者 暴露出来分词的接口,这样能够mapping上,或者直接能够返回一个dict
xiezi updated
7 years ago
-
参见 https://docs.readthedocs.io/en/latest/localization.html?highlight=language
-
使用的是python 3.4
pypinyin.slug('王', pypinyin.INITIALS, separator='')
无法正确获得 ‘y’, 而返回一个空串
-
https://github.com/hotoo/pinyin 的实现是:
> TONE 标准声调风格
> TONE2 声调以数字形式在末尾的风格(当初我这样命名的原因)
> TO3NE 声调以数字形式在中间的风格
详见:https://github.com/hotoo/pinyin/issues/79
考虑是否改为它这种风格。
-
首先谢谢提供如此便利的汉字转拼音工具
近日在使用时遇到这样的问题
``` python
>>> from pypinyin import lazy_pinyin
>>> lazy_pinyin('彷徨')
['panghuang']
```
预想得到的应该是['pang', 'huang']?
我的环境是Python 3.5.1, pypinyin 0.12.0
-
![image_1206_2358_001](https://cloud.githubusercontent.com/assets/3153534/11616159/4dcc51a0-9c75-11e5-8ca3-3249ff0a4a8f.png)
-
-help里的argument总是报错
-
```
>>> s=u"两年前七斤喝醉了酒"
>>> pypinyin.lazy_pinyin(s)
[u'liang', u'nian', u'qian', u'qi', u'jin', u'he', u'zui', u',he', u'zui', u'jiu', u'liao', u'jiu']
```
结果中多了`u',he', u'zui', u'jiu',` 应该是bug
node版…
-
在網路上看到「網」拼成 wa3ng,但用 pinyin 設定 style 為 TONE2 時,得出的是 wang3,請問這兩者差異為何?謝謝。
-
load_phrases_dict({'几': [['jǐ']]})
load_phrases_dict({'桔子': [['jú'], ['zǐ']]})
load_phrases_dict({'还没': [['hái'], ['méi']]})
load_phrases_dict({'不用谢':[['bú'], ['yòng'],['xiè']]})
Output
不用谢(bú yòng x…