promptTonesForPinyin static method

List<String> promptTonesForPinyin(
  1. String pinyin
)

Pass a tone or untoned pinyin and get a list of toned vowels that can be in this pinyin

Implementation

static List<String> promptTonesForPinyin(String pinyin) {
  final chars = HashSet<String>.from(
    PinyinUtils.simplifyPinyin(pinyin).split(''),
  ).toList();
  final temp = <String>[];
  for (var i = 0; i < chars.length; i++) {
    final char = chars[i];
    if (_mappedVowels.containsKey(char)) {
      temp.addAll(_mappedVowels[char]!);
    }
  }

  return temp;
}