Open gustanas opened 3 years ago
List<String> traditionalDict= [ '乾=干'];
ChineseHelper.addChineseDict(traditionalDict);
var testTrad = PinyinHelper.getPinyin('乾淨', format: PinyinFormat.WITH_TONE_MARK);
print(testTrad);
Thank you! It works already better!
But how about characters that have multiple pinyin? For example:
List<String> traditionalDict = ['乾=干'];
ChineseHelper.addChineseDict(traditionalDict);
var testTrad = PinyinHelper.getPinyin('乾燥', format: PinyinFormat.WITH_TONE_MARK);
var testTrad2 = PinyinHelper.getPinyin('乾坤', format: PinyinFormat.WITH_TONE_MARK);
print(testTrad);
print(testTrad2);
Output:
gān zào
gān kūn
Shoudn't it be qián kūn
instead? https://translate.google.com/?sl=zh-CN&tl=zh-CN&text=%E4%B9%BE%E7%87%A5%0A%E4%B9%BE%E5%9D%A4&op=translate
This is a problem, maybe this solution is better.
List<String> multiDict = ['乾净=gān,jìng', '乾燥=gān,zào'];
PinyinHelper.addMultiPinyinDict(multiDict);
var testTrad = PinyinHelper.getPinyin('乾淨', format: PinyinFormat.WITH_TONE_MARK);
print(testTrad);
Good suggestion, thank you for your help 🙏
Example:
Output: