splitToSyllablesBySeparator static method

String splitToSyllablesBySeparator(
  1. String value, [
  2. String separator = "'"
])

Implementation

static String splitToSyllablesBySeparator(
  String value, [
  String separator = "'",
]) {
  final spaceRegexp = RegExp(r"\s+");
  final apostropheRegexp = RegExp("[$separator]+");
  const empty = '';
  value = value
      .replaceAll(
        apostropheRegexp,
        empty,
      )
      .replaceAll(spaceRegexp, empty);
  return splitToSyllables<String>(value).join(separator);
}