PinyinHelper class

汉字转拼音类.

Constructors

PinyinHelper()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

maxMultiLength int
getter/setter pair
minMultiLength int
getter/setter pair
multiPinyinMap Map<String, String>
getter/setter pair
pinyinMap Map<String, String>
getter/setter pair

Static Methods

addMultiPinyinDict(List<String> list) → void
添加多音字字典
addPinyinDict(List<String> list) → void
添加拼音字典
convertCharToPinyinArray(String c) List<String>
将单个汉字转换成带声调格式的拼音 @param c 需要转换成拼音的汉字 @return 字符串的拼音
convertToMultiPinyin(String str, String separator, PinyinFormat format) MultiPinyin?
获取多音字拼音 @param str 需要转换的字符串 @param separator 拼音分隔符 @param format 拼音格式 @return 多音字拼音
convertToPinyinArray(String c, PinyinFormat format) List<String>
将单个汉字转换为相应格式的拼音 @param c 需要转换成拼音的汉字 @param format 拼音格式 @return 汉字的拼音
convertWithoutTone(String pinyinArrayStr) List<String>
将带声调格式的拼音转换为不带声调格式的拼音 @param pinyinArrayStr 带声调格式的拼音 @return 不带声调的拼音
convertWithToneNumber(String pinyinArrayStr) List<String>
将带声调格式的拼音转换为数字代表声调格式的拼音 @param pinyinArrayStr 带声调格式的拼音 @return 数字代表声调格式的拼音
formatPinyin(String pinyinStr, PinyinFormat format) List<String>
将带声调的拼音格式化为相应格式的拼音 @param pinyinStr 带声调格式的拼音 @param format 拼音格式 @return 格式转换后的拼音
getFirstWordPinyin(String str) String
获取字符串首字拼音 @param str 需要转换的字符串 @return 首字拼音 (成都 cheng)
getPinyin(String str, {String separator = ' ', PinyinFormat format = PinyinFormat.WITHOUT_TONE}) String
将字符串转换成相应格式的拼音 @param str 需要转换的字符串 @param separator 拼音分隔符 def: ' ' @param format 拼音格式 def: PinyinFormat.WITHOUT_TONE @return 字符串的拼音(成都 cheng du)
getPinyinE(String str, {String separator = ' ', String defPinyin = ' ', PinyinFormat format = PinyinFormat.WITHOUT_TONE}) String
将字符串转换成相应格式的拼音 (不能转换的字拼音默认用' '替代 ) @param str 需要转换的字符串 @param separator 拼音分隔符 def: ' ' @param defPinyin 默认拼音 def: ' ' @param format 拼音格式 def: PinyinFormat.WITHOUT_TONE @return 字符串的拼音(成都 cheng du)
getShortPinyin(String str) String
获取字符串对应拼音的首字母 @param str 需要转换的字符串 @return 对应拼音的首字母 (成都 cd)
hasMultiPinyin(String c) bool
判断一个汉字是否为多音字 @param c汉字 @return 判断结果,是汉字返回true,否则返回false

Constants

allMarkedVowel → const String
所有带声调的拼音字母
allUnmarkedVowel → const String
pinyinSeparator → const String
拼音分隔符