123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- (* these should probably be part of the stdlib eventually *)
- flatten := {[t] => tuple/fold[{ [x, xs] => x xs }, "", t]};
- word := {[w] => flatten[tuple/map[orthography, w]]};
- wd := tuple/concat[<begin, middle, end>];
- middle := syll | tuple/concat[<syll, syll>] | tuple/concat[<syll, syll, syll>] | tuple/concat[<syll, syll, syll, syll>];
- syll := <cons, vowel>;
- end := <cons, vowel, final>
- | 2: <cons, ("eː" | "a"), final>
- | <"r"> | <"n"> ;
- orthography := { [x] => case x in
- { "z" => "s"
- ; "s" => "ss"
- ; "dz" => "z"
- ; "kʷ" => "qu"
- ; "k" => "c"
- ; "x" => "ch"
- ; "ʎ" => "lh"
- ; "ɲ" => "nh"
- ; "ʃ" => "sc"
- ; "ts" => "tz"
- ; "aː" => "á"
- ; "eː" => "é"
- ; "iː" => "í"
- ; "oː" => "ó"
- ; "uː" => "ú"
- ; "ɛ" => "è"
- ; "ɔ" => "o"
- ; "ɾ" => "r"
- ; "tɾ" => "tr"
- ; "ɾt" => "rt"
- ; _ => x
- } };
- begin := <vowel> | <initcons, vowel>;
- cons ::= b k d d x d f g g ɲ h j l l l ʎ m m m n n n
- p kʷ ɾ z z z s s s ʃ ʃ t t t tg tj ts ts tɾ ɾt v dz;
- initcons ::= b k d x d f g ɲ h j l m n p kʷ ɾ s ʃ t v;
- vowel := 4: commonvowel | uncommonvowel;
- commonvowel ::= a i u e eː o;
- uncommonvowel ::= aː ɛ oː ɔ iː uː;
- final := "s" | 6: "";
- fix wd;
- puts word[wd] " (pronounced /" flatten[wd] "/)";
|