contrib¶
拼音转换¶
- pypinyin.contrib.tone_convert.to_normal(pinyin, v_to_u=False)[源代码]¶
将
TONE
、TONE2
或TONE3
风格的拼音转换为NORMAL
风格的拼音- 参数:
- 返回:
NORMAL
风格的拼音
Usage:
>>> from pypinyin.contrib.tone_convert import to_normal >>> to_normal('zhōng') 'zhong' >>> to_normal('zho1ng') 'zhong' >>> to_normal('zhong1') 'zhong' >>> to_normal('lüè') 'lve' >>> to_normal('lüè', v_to_u=True) 'lüe'
- pypinyin.contrib.tone_convert.to_tone(pinyin)[源代码]¶
将
TONE2
或TONE3
风格的拼音转换为TONE
风格的拼音Usage:
>>> from pypinyin.contrib.tone_convert import to_tone >>> to_tone('zho1ng') 'zhōng' >>> to_tone('zhong1') 'zhōng'
- pypinyin.contrib.tone_convert.to_tone2(pinyin, v_to_u=False, neutral_tone_with_five=False, **kwargs)[源代码]¶
将
TONE
或TONE3
风格的拼音转换为TONE2
风格的拼音- 参数:
- 返回:
TONE2
风格的拼音
Usage:
>>> from pypinyin.contrib.tone_convert import to_tone2 >>> to_tone2('zhōng') 'zho1ng' >>> to_tone2('zhong1') 'zho1ng' >>> to_tone2('shang') 'shang' >>> to_tone2('shang', neutral_tone_with_five=True) 'sha5ng' >>> to_tone2('lüè') 'lve4' >>> to_tone2('lüè', v_to_u=True) 'lüe4'
- pypinyin.contrib.tone_convert.to_tone3(pinyin, v_to_u=False, neutral_tone_with_five=False, **kwargs)[源代码]¶
将
TONE
或TONE2
风格的拼音转换为TONE3
风格的拼音- 参数:
- 返回:
TONE2
风格的拼音
Usage:
>>> from pypinyin.contrib.tone_convert import to_tone3 >>> to_tone3('zhōng') 'zhong1' >>> to_tone3('zho1ng') 'zhong1' >>> to_tone3('shang') 'shang' >>> to_tone3('shang', neutral_tone_with_five=True) 'shang5' >>> to_tone3('lüè') 'lve4' >>> to_tone3('lüè', v_to_u=True) 'lüe4'
- pypinyin.contrib.tone_convert.to_initials(pinyin, strict=True)[源代码]¶
将
TONE
、TONE2
、TONE3
或NORMAL
风格的拼音转换为INITIALS
风格的拼音- 参数:
strict – 返回结果是否严格遵照《汉语拼音方案》来处理声母和韵母, 详见 strict 参数的影响
- 返回:
INITIALS
风格的拼音
Usage:
>>> from pypinyin.contrib.tone_convert import to_initials >>> to_initials('zhōng') 'zh'
- pypinyin.contrib.tone_convert.to_finals(pinyin, strict=True, v_to_u=False)[源代码]¶
将
TONE
、TONE2
、TONE3
或NORMAL
风格的拼音转换为FINALS
风格的拼音- 参数:
strict – 返回结果是否严格遵照《汉语拼音方案》来处理声母和韵母, 详见 strict 参数的影响
v_to_u – 是否使用
ü
代替原来的v
, 当为 False 时结果中将使用v
表示ü
- 返回:
FINALS
风格的拼音
Usage:
>>> from pypinyin.contrib.tone_convert import to_finals >>> to_finals('zhōng') 'ong'
- pypinyin.contrib.tone_convert.to_finals_tone(pinyin, strict=True)[源代码]¶
将
TONE
、TONE2
或TONE3
风格的拼音转换为FINALS_TONE
风格的拼音- 参数:
strict – 返回结果是否严格遵照《汉语拼音方案》来处理声母和韵母, 详见 strict 参数的影响
- 返回:
FINALS_TONE
风格的拼音
Usage:
>>> from pypinyin.contrib.tone_convert import to_finals_tone >>> to_finals_tone('zhōng') 'ōng'
- pypinyin.contrib.tone_convert.to_finals_tone2(pinyin, strict=True, v_to_u=False, neutral_tone_with_five=False)[源代码]¶
将
TONE
、TONE2
或TONE3
风格的拼音转换为FINALS_TONE2
风格的拼音- 参数:
strict – 返回结果是否严格遵照《汉语拼音方案》来处理声母和韵母, 详见 strict 参数的影响
v_to_u – 是否使用
ü
代替原来的v
, 当为 False 时结果中将使用v
表示ü
neutral_tone_with_five – 是否使用
5
标识轻声
- 返回:
FINALS_TONE2
风格的拼音
Usage:
>>> from pypinyin.contrib.tone_convert import to_finals_tone2 >>> to_finals_tone2('zhōng') 'o1ng'
- pypinyin.contrib.tone_convert.to_finals_tone3(pinyin, strict=True, v_to_u=False, neutral_tone_with_five=False)[源代码]¶
将
TONE
、TONE2
或TONE3
风格的拼音转换为FINALS_TONE3
风格的拼音- 参数:
strict – 返回结果是否严格遵照《汉语拼音方案》来处理声母和韵母, 详见 strict 参数的影响
v_to_u – 是否使用
ü
代替原来的v
, 当为 False 时结果中将使用v
表示ü
neutral_tone_with_five – 是否使用
5
标识轻声
- 返回:
FINALS_TONE3
风格的拼音
Usage:
>>> from pypinyin.contrib.tone_convert import to_finals_tone3 >>> to_finals_tone3('zhōng') 'ong1'