halfling_ipa.matzo 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. (* these should probably be part of the stdlib eventually *)
  2. tuple-map := {func => {tup =>
  3. tuple-fold.<{xs => {x => concat.<xs, <func.x>>}}, <>, tup>
  4. }};
  5. flatten := {t => tuple-fold.<{ x => { xs => x xs } }, "", t>};
  6. word := {w => flatten.(tuple-map.orthography.w)};
  7. wd := concat.<begin, middle, end>;
  8. middle := syll | concat.<syll, syll> | concat.<syll, syll, syll> | concat.<syll, syll, syll, syll>;
  9. syll := <cons, vowel>;
  10. end := <cons, vowel, final>
  11. | 2: <cons, ("eː" | "a"), final>
  12. | <"r"> | <"n"> ;
  13. orthography :=
  14. { "z" => "s"
  15. ; "s" => "ss"
  16. ; "dz" => "z"
  17. ; "kʷ" => "qu"
  18. ; "k" => "c"
  19. ; "x" => "ch"
  20. ; "ʎ" => "lh"
  21. ; "ɲ" => "nh"
  22. ; "ʃ" => "sc"
  23. ; "ts" => "tz"
  24. ; "aː" => "á"
  25. ; "eː" => "é"
  26. ; "iː" => "í"
  27. ; "oː" => "ó"
  28. ; "uː" => "ú"
  29. ; "ɛ" => "è"
  30. ; "ɔ" => "o"
  31. ; "ɾ" => "r"
  32. ; "tɾ" => "tr"
  33. ; "ɾt" => "rt"
  34. ; x => x
  35. };
  36. begin := <vowel> | <initcons, vowel>;
  37. cons ::= b k d d x d f g g ɲ h j l l l ʎ m m m n n n
  38. p kʷ ɾ z z z s s s ʃ ʃ t t t tg tj ts ts tɾ ɾt v dz;
  39. initcons ::= b k d x d f g ɲ h j l m n p kʷ ɾ s ʃ t v;
  40. vowel := 4: commonvowel | uncommonvowel;
  41. commonvowel ::= a i u e eː o;
  42. uncommonvowel ::= aː ɛ oː ɔ iː uː;
  43. final := "s" | 6: "";
  44. fix wd;
  45. puts (word.wd) " (pronounced /" (flatten.wd) "/)";