mouth function

MouthingResult mouth(
  1. String word, {
  2. required GraphemeToIpa g2p,
  3. bool aspiration = false,
})

Mouths a written word for a spoken language, using a supplied g2p grapheme-to-IPA function (epitran has no Dart port — see EPITRAN_PORT.md).

Implementation

MouthingResult mouth(String word,
    {required GraphemeToIpa g2p, bool aspiration = false}) {
  final ipa = g2p(word);
  final fsw = mouthIpa(ipa, aspiration: aspiration);
  final swu = fsw != null ? fsw2swu(fsw) : null;
  return MouthingResult(ipa: ipa, fsw: fsw, swu: swu);
}