#! /bin/sed -f # Last edited on 2026-06-01 21:11:11 by stolfi # # Reads a pinyin file, assumed to be all lowercase, in Unicode UTF-8 # encoding. Writes the same after converting every vowel with a pinyin # tone diacritic into a plain vowel followed by a tone code [1-4]. # # Syllables without tone diacritics are not changed. s:ā:aK:g s:ē:eK:g s:ī:iK:g s:ō:oK:g s:ū:uK:g s:ǖ:üK:g s:á:aT:g s:é:eT:g s:í:iT:g s:ó:oT:g s:ú:uT:g s:ǘ:üT:g s:à:aP:g s:è:eP:g s:ì:iP:g s:ò:oP:g s:ù:uP:g s:ǜ:üP:g s:ǎ:aF:g s:ě:eF:g s:ǐ:iF:g s:ǒ:oF:g s:ǔ:uF:g s:ǚ:üF:g