normalizeVi static method

String normalizeVi(
  1. String text
)

Implementation

static String normalizeVi(String text) {
  String repl(Match m) {
    int alphabet = toNormalizeViChars.indexOf(m.group(1)!);
    int dmark = dmarkClass.indexOf(m.group(2)!); // Diacritical Mark
    return normalizedViChars[dmark][alphabet];
  }

  return text.replaceAllMapped(alphabetWithDmark, repl);
}