1 # © 2016 and later: Unicode, Inc. and others.
2 # License & terms of use: http://www.unicode.org/copyright.html#License
8 #--- forward filter, transforms ----
9 # currently in reverse it only goes back to Latin with numeric tones (not sure why); ok but would rather have marks.
11 :: [[:Latin:][:Mn:][1-5]]; # forward filter: only modifies Latin and tone marks/digits
13 #--- remap v (alternate for ü) to ü, one way ----
16 :: Latin-NumericPinyin(NumericPinyin-Latin); # tone marks in middle ↔ digits at end to use numeric below; this leaves the pinyin in NFC
20 # basic pinyin and zhuyin consonant initials (not including vowel initials):
21 $pCons = [b p m f d t n l g k h j q x r z c s]; # and zh ch sh, covered for this by h already in the set
24 # pinyin and zhuyin minus basic consonant initials that cannot take tones by themselves
25 # (in some cases the exclusion is only for the pinyin, not the corresponding zhuyin: zh ch sh r z c s)
26 $pToneOK = [[a-z] - [b p f d t l g k h j q x r z c s]]; # and minus zh ch sh, covered for this by h already in the exclusion set
27 $zToneOK = [[ㄅ-ㄩ] - [ㄅ ㄆ ㄈ ㄉ ㄊ ㄌ ㄍ ㄎ ㄏ ㄐ ㄑ ㄒ]];
29 # basic consonant initials that can take tones by themselves
30 # (in some cases this is only for the zhuyin, not the corresponding pinyin: ㄓ ㄔ ㄕ ㄖ ㄗ ㄘ ㄙ)
31 # $pConsToneOK = [m n];
32 # $zConsToneOK = [ㄇ ㄋ ㄓ ㄔ ㄕ ㄖ ㄗ ㄘ ㄙ];
34 # basic numeric pinyin and zhuyin tones
38 #--- clusters with initial consonant ----
40 bang }$pTone ↔ ㄅㄤ }$zTone;
43 beng }$pTone ↔ ㄅㄥ }$zTone;
46 biao }$pTone ↔ ㄅㄧㄠ }$zTone;
49 bian }$pTone ↔ ㄅㄧㄢ }$zTone;
52 bing }$pTone ↔ ㄅㄧㄥ }$zTone;
55 bai }$pTone ↔ ㄅㄞ }$zTone;
58 bei }$pTone ↔ ㄅㄟ }$zTone;
61 bao }$pTone ↔ ㄅㄠ }$zTone;
64 ban }$pTone ↔ ㄅㄢ }$zTone;
67 ben }$pTone ↔ ㄅㄣ }$zTone;
70 bie }$pTone ↔ ㄅㄧㄝ }$zTone;
73 bin }$pTone ↔ ㄅㄧㄣ }$zTone;
76 bun }$pTone ↔ ㄅㄨㄣ }$zTone;
79 ba }$pTone ↔ ㄅㄚ }$zTone;
82 bo }$pTone ↔ ㄅㄛ }$zTone;
85 bi }$pTone ↔ ㄅㄧ }$zTone;
88 bu }$pTone ↔ ㄅㄨ }$zTone;
92 pang }$pTone ↔ ㄆㄤ }$zTone;
95 peng }$pTone ↔ ㄆㄥ }$zTone;
98 piao }$pTone ↔ ㄆㄧㄠ }$zTone;
101 pian }$pTone ↔ ㄆㄧㄢ }$zTone;
104 ping }$pTone ↔ ㄆㄧㄥ }$zTone;
107 pai }$pTone ↔ ㄆㄞ }$zTone;
110 pei }$pTone ↔ ㄆㄟ }$zTone;
113 pao }$pTone ↔ ㄆㄠ }$zTone;
116 pou }$pTone ↔ ㄆㄡ }$zTone;
119 pan }$pTone ↔ ㄆㄢ }$zTone;
122 pen }$pTone ↔ ㄆㄣ }$zTone;
125 pie }$pTone ↔ ㄆㄧㄝ }$zTone;
128 pin }$pTone ↔ ㄆㄧㄣ }$zTone;
131 pa }$pTone ↔ ㄆㄚ }$zTone;
134 po }$pTone ↔ ㄆㄛ }$zTone;
137 pi }$pTone ↔ ㄆㄧ }$zTone;
140 pu }$pTone ↔ ㄆㄨ }$zTone;
144 mang }$pTone ↔ ㄇㄤ }$zTone;
147 meng }$pTone ↔ ㄇㄥ }$zTone;
150 miao }$pTone ↔ ㄇㄧㄠ }$zTone;
153 mian }$pTone ↔ ㄇㄧㄢ }$zTone;
156 ming }$pTone ↔ ㄇㄧㄥ }$zTone;
159 mai }$pTone ↔ ㄇㄞ }$zTone;
162 mei }$pTone ↔ ㄇㄟ }$zTone;
165 mao }$pTone ↔ ㄇㄠ }$zTone;
168 mou }$pTone ↔ ㄇㄡ }$zTone;
171 man }$pTone ↔ ㄇㄢ }$zTone;
174 men }$pTone ↔ ㄇㄣ }$zTone;
177 mie }$pTone ↔ ㄇㄧㄝ }$zTone;
180 miu }$pTone ↔ ㄇㄧㄡ }$zTone;
183 min }$pTone ↔ ㄇㄧㄣ }$zTone;
186 ma }$pTone ↔ ㄇㄚ }$zTone;
189 mo }$pTone ↔ ㄇㄛ }$zTone;
192 me }$pTone ↔ ㄇㄜ }$zTone;
195 mi }$pTone ↔ ㄇㄧ }$zTone;
198 mu }$pTone ↔ ㄇㄨ }$zTone;
203 fang }$pTone ↔ ㄈㄤ }$zTone;
206 feng }$pTone ↔ ㄈㄥ }$zTone;
209 fiao }$pTone ↔ ㄈㄧㄠ }$zTone;
212 fei }$pTone ↔ ㄈㄟ }$zTone;
215 fou }$pTone ↔ ㄈㄡ }$zTone;
218 fan }$pTone ↔ ㄈㄢ }$zTone;
221 fen }$pTone ↔ ㄈㄣ }$zTone;
224 fa }$pTone ↔ ㄈㄚ }$zTone;
227 fo }$pTone ↔ ㄈㄛ }$zTone;
230 fu }$pTone ↔ ㄈㄨ }$zTone;
234 diang }$pTone ↔ ㄉㄧㄤ }$zTone; # (not in han-latin)
237 dang }$pTone ↔ ㄉㄤ }$zTone;
240 deng }$pTone ↔ ㄉㄥ }$zTone;
243 diao }$pTone ↔ ㄉㄧㄠ }$zTone;
246 dian }$pTone ↔ ㄉㄧㄢ }$zTone;
249 ding }$pTone ↔ ㄉㄧㄥ }$zTone;
252 duan }$pTone ↔ ㄉㄨㄢ }$zTone;
255 dong }$pTone ↔ ㄉㄨㄥ }$zTone;
258 dai }$pTone ↔ ㄉㄞ }$zTone;
261 dei }$pTone ↔ ㄉㄟ }$zTone; # (not in han-latin)
264 dao }$pTone ↔ ㄉㄠ }$zTone;
267 dou }$pTone ↔ ㄉㄡ }$zTone;
270 dan }$pTone ↔ ㄉㄢ }$zTone;
273 den }$pTone ↔ ㄉㄣ }$zTone;
276 dia }$pTone ↔ ㄉㄧㄚ }$zTone;
279 die }$pTone ↔ ㄉㄧㄝ }$zTone;
282 diu }$pTone ↔ ㄉㄧㄡ }$zTone;
285 din }$pTone ↔ ㄉㄧㄣ }$zTone;
288 duo }$pTone ↔ ㄉㄨㄛ }$zTone;
291 dui }$pTone ↔ ㄉㄨㄟ }$zTone;
294 dun }$pTone ↔ ㄉㄨㄣ }$zTone;
297 da }$pTone ↔ ㄉㄚ }$zTone;
300 de }$pTone ↔ ㄉㄜ }$zTone;
303 di }$pTone ↔ ㄉㄧ }$zTone;
306 du }$pTone ↔ ㄉㄨ }$zTone;
310 tang }$pTone ↔ ㄊㄤ }$zTone;
313 teng }$pTone ↔ ㄊㄥ }$zTone;
316 tiao }$pTone ↔ ㄊㄧㄠ }$zTone;
319 tian }$pTone ↔ ㄊㄧㄢ }$zTone;
322 ting }$pTone ↔ ㄊㄧㄥ }$zTone;
325 tuan }$pTone ↔ ㄊㄨㄢ }$zTone;
328 tong }$pTone ↔ ㄊㄨㄥ }$zTone;
331 tai }$pTone ↔ ㄊㄞ }$zTone;
334 tao }$pTone ↔ ㄊㄠ }$zTone;
337 tou }$pTone ↔ ㄊㄡ }$zTone;
340 tan }$pTone ↔ ㄊㄢ }$zTone;
343 tie }$pTone ↔ ㄊㄧㄝ }$zTone;
346 tuo }$pTone ↔ ㄊㄨㄛ }$zTone;
349 tui }$pTone ↔ ㄊㄨㄟ }$zTone;
352 tun }$pTone ↔ ㄊㄨㄣ }$zTone;
355 ta }$pTone ↔ ㄊㄚ }$zTone;
358 te }$pTone ↔ ㄊㄜ }$zTone;
361 ti }$pTone ↔ ㄊㄧ }$zTone;
364 tu }$pTone ↔ ㄊㄨ }$zTone;
368 niang }$pTone ↔ ㄋㄧㄤ }$zTone;
371 nang }$pTone ↔ ㄋㄤ }$zTone;
374 neng }$pTone ↔ ㄋㄥ }$zTone;
377 niao }$pTone ↔ ㄋㄧㄠ }$zTone;
380 nian }$pTone ↔ ㄋㄧㄢ }$zTone;
383 ning }$pTone ↔ ㄋㄧㄥ }$zTone;
386 nuan }$pTone ↔ ㄋㄨㄢ }$zTone;
389 nong }$pTone ↔ ㄋㄨㄥ }$zTone;
392 nai }$pTone ↔ ㄋㄞ }$zTone;
395 nei }$pTone ↔ ㄋㄟ }$zTone;
398 nao }$pTone ↔ ㄋㄠ }$zTone;
401 nou }$pTone ↔ ㄋㄡ }$zTone;
404 nan }$pTone ↔ ㄋㄢ }$zTone;
407 nen }$pTone ↔ ㄋㄣ }$zTone;
410 nia }$pTone ↔ ㄋㄧㄚ }$zTone; # (not in han-latin)
413 nie }$pTone ↔ ㄋㄧㄝ }$zTone;
416 niu }$pTone ↔ ㄋㄧㄡ }$zTone;
419 nin }$pTone ↔ ㄋㄧㄣ }$zTone;
422 nuo }$pTone ↔ ㄋㄨㄛ }$zTone;
425 nun }$pTone ↔ ㄋㄨㄣ }$zTone;
428 nüe }$pTone ↔ ㄋㄩㄝ }$zTone;
431 nue }$pTone → ㄋㄩㄝ; # (not in han-latin) one-way, handle wrong u
433 na }$pTone ↔ ㄋㄚ }$zTone;
436 ne }$pTone ↔ ㄋㄜ }$zTone;
439 ni }$pTone ↔ ㄋㄧ }$zTone;
442 nu }$pTone ↔ ㄋㄨ }$zTone;
445 nü }$pTone ↔ ㄋㄩ }$zTone;
450 liang }$pTone ↔ ㄌㄧㄤ }$zTone;
453 lang }$pTone ↔ ㄌㄤ }$zTone;
456 leng }$pTone ↔ ㄌㄥ }$zTone;
459 liao }$pTone ↔ ㄌㄧㄠ }$zTone;
462 lian }$pTone ↔ ㄌㄧㄢ }$zTone;
465 ling }$pTone ↔ ㄌㄧㄥ }$zTone;
468 luan }$pTone ↔ ㄌㄨㄢ }$zTone;
471 long }$pTone ↔ ㄌㄨㄥ }$zTone;
474 lüan }$pTone ↔ ㄌㄩㄢ }$zTone; # (not in han-latin)
477 lai }$pTone ↔ ㄌㄞ }$zTone;
480 lei }$pTone ↔ ㄌㄟ }$zTone;
483 lao }$pTone ↔ ㄌㄠ }$zTone;
486 lou }$pTone ↔ ㄌㄡ }$zTone;
489 lan }$pTone ↔ ㄌㄢ }$zTone;
492 lia }$pTone ↔ ㄌㄧㄚ }$zTone;
495 lie }$pTone ↔ ㄌㄧㄝ }$zTone;
498 liu }$pTone ↔ ㄌㄧㄡ }$zTone;
501 lin }$pTone ↔ ㄌㄧㄣ }$zTone;
504 luo }$pTone ↔ ㄌㄨㄛ }$zTone;
507 lun }$pTone ↔ ㄌㄨㄣ }$zTone;
510 lüe }$pTone ↔ ㄌㄩㄝ }$zTone;
513 lue }$pTone → ㄌㄩㄝ; # (not in han-latin) one-way, handle wrong u
515 la }$pTone ↔ ㄌㄚ }$zTone;
518 lo }$pTone ↔ ㄌㄛ }$zTone;
521 le }$pTone ↔ ㄌㄜ }$zTone;
524 li }$pTone ↔ ㄌㄧ }$zTone;
527 lu }$pTone ↔ ㄌㄨ }$zTone;
530 lü }$pTone ↔ ㄌㄩ }$zTone;
534 guang }$pTone ↔ ㄍㄨㄤ }$zTone;
537 gang }$pTone ↔ ㄍㄤ }$zTone;
540 geng }$pTone ↔ ㄍㄥ }$zTone;
543 guai }$pTone ↔ ㄍㄨㄞ }$zTone;
546 guan }$pTone ↔ ㄍㄨㄢ }$zTone;
549 gong }$pTone ↔ ㄍㄨㄥ }$zTone;
552 gai }$pTone ↔ ㄍㄞ }$zTone;
555 gei }$pTone ↔ ㄍㄟ }$zTone;
558 gao }$pTone ↔ ㄍㄠ }$zTone;
561 gou }$pTone ↔ ㄍㄡ }$zTone;
564 gan }$pTone ↔ ㄍㄢ }$zTone;
567 gen }$pTone ↔ ㄍㄣ }$zTone;
570 gua }$pTone ↔ ㄍㄨㄚ }$zTone;
573 guo }$pTone ↔ ㄍㄨㄛ }$zTone;
576 gui }$pTone ↔ ㄍㄨㄟ }$zTone;
579 gun }$pTone ↔ ㄍㄨㄣ }$zTone;
582 ga }$pTone ↔ ㄍㄚ }$zTone;
585 ge }$pTone ↔ ㄍㄜ }$zTone;
588 gi }$pTone ↔ ㄍㄧ }$zTone;
591 gu }$pTone ↔ ㄍㄨ }$zTone;
595 kuang }$pTone ↔ ㄎㄨㄤ }$zTone;
598 kang }$pTone ↔ ㄎㄤ }$zTone;
601 keng }$pTone ↔ ㄎㄥ }$zTone;
604 kuai }$pTone ↔ ㄎㄨㄞ }$zTone;
607 kuan }$pTone ↔ ㄎㄨㄢ }$zTone;
610 kong }$pTone ↔ ㄎㄨㄥ }$zTone;
613 kai }$pTone ↔ ㄎㄞ }$zTone;
616 kao }$pTone ↔ ㄎㄠ }$zTone;
619 kou }$pTone ↔ ㄎㄡ }$zTone;
622 kan }$pTone ↔ ㄎㄢ }$zTone;
625 ken }$pTone ↔ ㄎㄣ }$zTone;
628 kua }$pTone ↔ ㄎㄨㄚ }$zTone;
631 kuo }$pTone ↔ ㄎㄨㄛ }$zTone;
634 kui }$pTone ↔ ㄎㄨㄟ }$zTone;
637 kun }$pTone ↔ ㄎㄨㄣ }$zTone;
640 ka }$pTone ↔ ㄎㄚ }$zTone;
643 ke }$pTone ↔ ㄎㄜ }$zTone;
646 ku }$pTone ↔ ㄎㄨ }$zTone;
650 huang }$pTone ↔ ㄏㄨㄤ }$zTone;
653 hang }$pTone ↔ ㄏㄤ }$zTone;
656 heng }$pTone ↔ ㄏㄥ }$zTone;
659 huai }$pTone ↔ ㄏㄨㄞ }$zTone;
662 huan }$pTone ↔ ㄏㄨㄢ }$zTone;
665 hong }$pTone ↔ ㄏㄨㄥ }$zTone;
668 hai }$pTone ↔ ㄏㄞ }$zTone;
671 hei }$pTone ↔ ㄏㄟ }$zTone;
674 hao }$pTone ↔ ㄏㄠ }$zTone;
677 hou }$pTone ↔ ㄏㄡ }$zTone;
680 han }$pTone ↔ ㄏㄢ }$zTone;
683 hen }$pTone ↔ ㄏㄣ }$zTone;
686 hua }$pTone ↔ ㄏㄨㄚ }$zTone;
689 huo }$pTone ↔ ㄏㄨㄛ }$zTone;
692 hui }$pTone ↔ ㄏㄨㄟ }$zTone;
695 hun }$pTone ↔ ㄏㄨㄣ }$zTone;
698 hm }$pTone ↔ ㄏㄇ }$zTone;
701 ha }$pTone ↔ ㄏㄚ }$zTone;
704 ho }$pTone ↔ ㄏㄛ }$zTone;
707 he }$pTone ↔ ㄏㄜ }$zTone;
710 hu }$pTone ↔ ㄏㄨ }$zTone;
714 jiang }$pTone ↔ ㄐㄧㄤ }$zTone;
717 jiong }$pTone ↔ ㄐㄩㄥ }$zTone;
720 jiao }$pTone ↔ ㄐㄧㄠ }$zTone;
723 jian }$pTone ↔ ㄐㄧㄢ }$zTone;
726 jing }$pTone ↔ ㄐㄧㄥ }$zTone;
729 juan }$pTone ↔ ㄐㄩㄢ }$zTone;
732 jia }$pTone ↔ ㄐㄧㄚ }$zTone;
735 jie }$pTone ↔ ㄐㄧㄝ }$zTone;
738 jiu }$pTone ↔ ㄐㄧㄡ }$zTone;
741 jin }$pTone ↔ ㄐㄧㄣ }$zTone;
744 jue }$pTone ↔ ㄐㄩㄝ }$zTone;
747 jun }$pTone ↔ ㄐㄩㄣ }$zTone;
750 ji }$pTone ↔ ㄐㄧ }$zTone;
753 ju }$pTone ↔ ㄐㄩ }$zTone;
757 qiang }$pTone ↔ ㄑㄧㄤ }$zTone;
760 qiong }$pTone ↔ ㄑㄩㄥ }$zTone;
763 qiao }$pTone ↔ ㄑㄧㄠ }$zTone;
766 qian }$pTone ↔ ㄑㄧㄢ }$zTone;
769 qing }$pTone ↔ ㄑㄧㄥ }$zTone;
772 quan }$pTone ↔ ㄑㄩㄢ }$zTone;
775 qia }$pTone ↔ ㄑㄧㄚ }$zTone;
778 qie }$pTone ↔ ㄑㄧㄝ }$zTone;
781 qiu }$pTone ↔ ㄑㄧㄡ }$zTone;
784 qin }$pTone ↔ ㄑㄧㄣ }$zTone;
787 que }$pTone ↔ ㄑㄩㄝ }$zTone;
790 qun }$pTone ↔ ㄑㄩㄣ }$zTone;
793 qi }$pTone ↔ ㄑㄧ }$zTone;
796 qu }$pTone ↔ ㄑㄩ }$zTone;
800 xiang }$pTone ↔ ㄒㄧㄤ }$zTone;
803 xiong }$pTone ↔ ㄒㄩㄥ }$zTone;
806 xiao }$pTone ↔ ㄒㄧㄠ }$zTone;
809 xian }$pTone ↔ ㄒㄧㄢ }$zTone;
812 xing }$pTone ↔ ㄒㄧㄥ }$zTone;
815 xuan }$pTone ↔ ㄒㄩㄢ }$zTone;
818 xia }$pTone ↔ ㄒㄧㄚ }$zTone;
821 xie }$pTone ↔ ㄒㄧㄝ }$zTone;
824 xiu }$pTone ↔ ㄒㄧㄡ }$zTone;
827 xin }$pTone ↔ ㄒㄧㄣ }$zTone;
830 xue }$pTone ↔ ㄒㄩㄝ }$zTone;
833 xun }$pTone ↔ ㄒㄩㄣ }$zTone;
836 xi }$pTone ↔ ㄒㄧ }$zTone;
839 xu }$pTone ↔ ㄒㄩ }$zTone;
843 zhuang }$pTone ↔ ㄓㄨㄤ }$zTone;
846 zhang }$pTone ↔ ㄓㄤ }$zTone;
849 zheng }$pTone ↔ ㄓㄥ }$zTone;
852 zhuai }$pTone ↔ ㄓㄨㄞ }$zTone;
855 zhuan }$pTone ↔ ㄓㄨㄢ }$zTone;
858 zhong }$pTone ↔ ㄓㄨㄥ }$zTone;
861 zhai }$pTone ↔ ㄓㄞ }$zTone;
864 zhei }$pTone ↔ ㄓㄟ }$zTone; # (not in han-latin)
867 zhao }$pTone ↔ ㄓㄠ }$zTone;
870 zhou }$pTone ↔ ㄓㄡ }$zTone;
873 zhan }$pTone ↔ ㄓㄢ }$zTone;
876 zhen }$pTone ↔ ㄓㄣ }$zTone;
879 zhua }$pTone ↔ ㄓㄨㄚ }$zTone;
882 zhuo }$pTone ↔ ㄓㄨㄛ }$zTone;
885 zhui }$pTone ↔ ㄓㄨㄟ }$zTone;
888 zhun }$pTone ↔ ㄓㄨㄣ }$zTone;
891 zha }$pTone ↔ ㄓㄚ }$zTone;
894 zhe }$pTone ↔ ㄓㄜ }$zTone;
897 zhu }$pTone ↔ ㄓㄨ }$zTone;
900 zhi }$pTone ↔ ㄓ }$zTone;
904 chuang }$pTone ↔ ㄔㄨㄤ }$zTone;
907 chang }$pTone ↔ ㄔㄤ }$zTone;
910 cheng }$pTone ↔ ㄔㄥ }$zTone;
913 chuai }$pTone ↔ ㄔㄨㄞ }$zTone;
916 chuan }$pTone ↔ ㄔㄨㄢ }$zTone;
919 chong }$pTone ↔ ㄔㄨㄥ }$zTone;
922 chai }$pTone ↔ ㄔㄞ }$zTone;
925 chao }$pTone ↔ ㄔㄠ }$zTone;
928 chou }$pTone ↔ ㄔㄡ }$zTone;
931 chan }$pTone ↔ ㄔㄢ }$zTone;
934 chen }$pTone ↔ ㄔㄣ }$zTone;
937 chua }$pTone ↔ ㄔㄨㄚ }$zTone;
940 chuo }$pTone ↔ ㄔㄨㄛ }$zTone;
943 chui }$pTone ↔ ㄔㄨㄟ }$zTone;
946 chun }$pTone ↔ ㄔㄨㄣ }$zTone;
949 cha }$pTone ↔ ㄔㄚ }$zTone;
952 che }$pTone ↔ ㄔㄜ }$zTone;
955 chu }$pTone ↔ ㄔㄨ }$zTone;
958 chi }$pTone ↔ ㄔ }$zTone;
962 shuang }$pTone ↔ ㄕㄨㄤ }$zTone;
965 shong }$pTone ↔ ㄕㄡㄥ }$zTone; # (not in han-latin)
968 shang }$pTone ↔ ㄕㄤ }$zTone;
971 sheng }$pTone ↔ ㄕㄥ }$zTone;
974 shuai }$pTone ↔ ㄕㄨㄞ }$zTone;
977 shuan }$pTone ↔ ㄕㄨㄢ }$zTone;
980 shai }$pTone ↔ ㄕㄞ }$zTone;
983 shei }$pTone ↔ ㄕㄟ }$zTone; # (not in han-latin)
986 shao }$pTone ↔ ㄕㄠ }$zTone;
989 shou }$pTone ↔ ㄕㄡ }$zTone;
992 shan }$pTone ↔ ㄕㄢ }$zTone;
995 shen }$pTone ↔ ㄕㄣ }$zTone;
998 shua }$pTone ↔ ㄕㄨㄚ }$zTone;
1001 shuo }$pTone ↔ ㄕㄨㄛ }$zTone;
1004 shui }$pTone ↔ ㄕㄨㄟ }$zTone;
1007 shun }$pTone ↔ ㄕㄨㄣ }$zTone;
1010 sha }$pTone ↔ ㄕㄚ }$zTone;
1013 she }$pTone ↔ ㄕㄜ }$zTone;
1016 shu }$pTone ↔ ㄕㄨ }$zTone;
1019 shi }$pTone ↔ ㄕ }$zTone;
1023 rang }$pTone ↔ ㄖㄤ }$zTone;
1026 reng }$pTone ↔ ㄖㄥ }$zTone;
1029 ruan }$pTone ↔ ㄖㄨㄢ }$zTone;
1032 rong }$pTone ↔ ㄖㄨㄥ }$zTone;
1035 rao }$pTone ↔ ㄖㄠ }$zTone;
1038 rou }$pTone ↔ ㄖㄡ }$zTone;
1041 ran }$pTone ↔ ㄖㄢ }$zTone;
1044 ren }$pTone ↔ ㄖㄣ }$zTone;
1047 ruo }$pTone ↔ ㄖㄨㄛ }$zTone;
1050 rui }$pTone ↔ ㄖㄨㄟ }$zTone;
1053 run }$pTone ↔ ㄖㄨㄣ }$zTone;
1056 ra }$pTone ↔ ㄖㄚ }$zTone;
1059 re }$pTone ↔ ㄖㄜ }$zTone;
1062 ru }$pTone ↔ ㄖㄨ }$zTone;
1065 ri }$pTone ↔ ㄖ }$zTone;
1069 zang }$pTone ↔ ㄗㄤ }$zTone;
1072 zeng }$pTone ↔ ㄗㄥ }$zTone;
1075 zuan }$pTone ↔ ㄗㄨㄢ }$zTone;
1078 zong }$pTone ↔ ㄗㄨㄥ }$zTone;
1081 zai }$pTone ↔ ㄗㄞ }$zTone;
1084 zei }$pTone ↔ ㄗㄟ }$zTone;
1087 zao }$pTone ↔ ㄗㄠ }$zTone;
1090 zou }$pTone ↔ ㄗㄡ }$zTone;
1093 zan }$pTone ↔ ㄗㄢ }$zTone;
1096 zen }$pTone ↔ ㄗㄣ }$zTone;
1099 zuo }$pTone ↔ ㄗㄨㄛ }$zTone;
1102 zui }$pTone ↔ ㄗㄨㄟ }$zTone;
1105 zun }$pTone ↔ ㄗㄨㄣ }$zTone;
1108 za }$pTone ↔ ㄗㄚ }$zTone;
1111 ze }$pTone ↔ ㄗㄜ }$zTone;
1114 zu }$pTone ↔ ㄗㄨ }$zTone;
1117 zi }$pTone ↔ ㄗ }$zTone;
1121 cang }$pTone ↔ ㄘㄤ }$zTone;
1124 ceng }$pTone ↔ ㄘㄥ }$zTone;
1127 cuan }$pTone ↔ ㄘㄨㄢ }$zTone;
1130 cong }$pTone ↔ ㄘㄨㄥ }$zTone;
1133 cai }$pTone ↔ ㄘㄞ }$zTone;
1136 cao }$pTone ↔ ㄘㄠ }$zTone;
1139 cou }$pTone ↔ ㄘㄡ }$zTone;
1142 can }$pTone ↔ ㄘㄢ }$zTone;
1145 cen }$pTone ↔ ㄘㄣ }$zTone;
1148 cuo }$pTone ↔ ㄘㄨㄛ }$zTone;
1151 cui }$pTone ↔ ㄘㄨㄟ }$zTone;
1154 cun }$pTone ↔ ㄘㄨㄣ }$zTone;
1157 ca }$pTone ↔ ㄘㄚ }$zTone;
1160 ce }$pTone ↔ ㄘㄜ }$zTone;
1163 cu }$pTone ↔ ㄘㄨ }$zTone;
1166 ci }$pTone ↔ ㄘ }$zTone;
1170 sang }$pTone ↔ ㄙㄤ }$zTone;
1173 seng }$pTone ↔ ㄙㄥ }$zTone;
1176 suan }$pTone ↔ ㄙㄨㄢ }$zTone;
1179 song }$pTone ↔ ㄙㄨㄥ }$zTone;
1182 sai }$pTone ↔ ㄙㄞ }$zTone;
1185 sei }$pTone ↔ ㄙㄟ }$zTone; # (not in han-latin)
1188 sao }$pTone ↔ ㄙㄠ }$zTone;
1191 sou }$pTone ↔ ㄙㄡ }$zTone;
1194 san }$pTone ↔ ㄙㄢ }$zTone;
1197 sen }$pTone ↔ ㄙㄣ }$zTone;
1200 suo }$pTone ↔ ㄙㄨㄛ }$zTone;
1203 sui }$pTone ↔ ㄙㄨㄟ }$zTone;
1206 sun }$pTone ↔ ㄙㄨㄣ }$zTone;
1209 sa }$pTone ↔ ㄙㄚ }$zTone;
1212 se }$pTone ↔ ㄙㄜ }$zTone;
1215 su }$pTone ↔ ㄙㄨ }$zTone;
1218 si }$pTone ↔ ㄙ }$zTone;
1222 #--- vowels and vowel compounds ----
1223 # most exist as syllables by themselves and they are also used as finals for initial consonants
1225 yuan }$pTone ↔ ㄩㄢ }$zTone;
1228 yong }$pTone ↔ ㄩㄥ }$zTone;
1231 yue }$pTone ↔ ㄩㄝ }$zTone;
1234 yun }$pTone ↔ ㄩㄣ }$zTone;
1237 yu }$pTone ↔ ㄩ }$zTone;
1242 yang }$pTone ↔ ㄧㄤ }$zTone;
1245 ying }$pTone ↔ ㄧㄥ }$zTone;
1248 yai }$pTone ↔ ㄧㄞ }$zTone; # (not in han-latin)
1251 yao }$pTone ↔ ㄧㄠ }$zTone;
1254 you }$pTone ↔ ㄧㄡ }$zTone;
1257 yan }$pTone ↔ ㄧㄢ }$zTone;
1260 yin }$pTone ↔ ㄧㄣ }$zTone;
1263 ya }$pTone ↔ ㄧㄚ }$zTone;
1266 yo }$pTone ↔ ㄧㄛ }$zTone;
1269 ye }$pTone ↔ ㄧㄝ }$zTone;
1272 yi }$pTone ↔ ㄧ }$zTone;
1277 wong }$pTone ↔ ㄨㄨㄥ }$zTone;
1280 wang }$pTone ↔ ㄨㄤ }$zTone;
1283 weng }$pTone ↔ ㄨㄥ }$zTone;
1286 wai }$pTone ↔ ㄨㄞ }$zTone;
1289 wei }$pTone ↔ ㄨㄟ }$zTone;
1292 wan }$pTone ↔ ㄨㄢ }$zTone;
1295 wen }$pTone ↔ ㄨㄣ }$zTone;
1298 wa }$pTone ↔ ㄨㄚ }$zTone;
1301 wo }$pTone ↔ ㄨㄛ }$zTone;
1304 wu }$pTone ↔ ㄨ }$zTone;
1309 ang }$pTone ↔ ㄤ }$zTone;
1312 eng }$pTone ↔ ㄥ }$zTone;
1315 eh }$pTone ↔ ㄝ }$zTone; # (not in han-latin)
1318 ea }$pTone → ㄝ; # (not in han-latin) one-way
1320 ai }$pTone ↔ ㄞ }$zTone;
1323 ei }$pTone ↔ ㄟ }$zTone;
1326 ao }$pTone ↔ ㄠ }$zTone;
1329 au }$pTone → ㄠ; # (not in han-latin) one-way, handle unicode spelling
1331 ou }$pTone ↔ ㄡ }$zTone;
1334 an }$pTone ↔ ㄢ }$zTone;
1337 en }$pTone ↔ ㄣ }$zTone;
1340 er }$pTone ↔ ㄦ }$zTone;
1343 a }$pTone ↔ ㄚ }$zTone;
1346 o }$pTone ↔ ㄛ }$zTone;
1349 e }$pTone ↔ ㄜ }$zTone;
1353 # handle unicode spellings of ㄧ,ㄨ,ㄩ above
1354 iu }$pTone → ㄩ; # (not in han-latin) one-way, handle unicode spelling
1356 i }$pTone → ㄧ; # (not in han-latin) one-way, handle unicode spelling
1358 u }$pTone → ㄨ; # (not in han-latin) one-way, handle unicode spelling
1361 #--- clusters with a single pinyin consonant that can apear in other clusters ----
1363 m }$pTone ↔ ㄇ }$zTone;
1367 n }$pTone ↔ ㄋ }$zTone;
1371 #--- fallback mappings ----
1373 # separate fallback mappings for some compound finals after consonants
1374 # (different pinyin than the standalone mappings for these zhuyin sequences).
1377 # would be nice to have these, need to work out how;
1378 # something like the following, but need to avoid conflicts with mappings above:
1379 # $pCons{ ia }$pTone ↔ $zCons{ ㄧㄚ }$zTone; # fallback mapping for unambiguous compound final
1383 # the relevant mappings are:
1401 # separate fallback mappings for some initial consonants not handled above
1402 # none of the mapped consonants handled here can have tones, so this is simple
1405 # m ↔ ㄇ; # handled above
1409 # n ↔ ㄋ; # handled above
1417 zh → ㄓ; # reverse mapping to zhi handled above
1418 ch → ㄔ; # reverse mapping to chi handled above
1419 sh → ㄕ; # reverse mapping to shi handled above
1420 r → ㄖ; # reverse mapping to ri handled above
1421 z → ㄗ; # reverse mapping to zi handled above
1422 c → ㄘ; # reverse mapping to ci handled above
1423 s → ㄙ; # reverse mapping to si handled above
1425 #--- tones (except for the ummarked cases handled above) ----
1427 # tone 1: pinyin \u0304 or 1 ↔ zhuyin typically unmarked or use ˉ \u02C9
1428 1 → ; # map to nothing
1429 1 ← ˉ ; # transform if marked in zhuyin
1430 # did the following with rules for each cluster, above
1431 # 1 ← ; # map nothing in zhuyin to pinyin mark
1434 # $pToneOK{ 2 ↔ $zToneOK{ ˊ; # pinyin \u0301 or 2 ↔ zhuyin \u02CA
1435 # $pToneOK{ 3 ↔ $zToneOK{ ˇ; # pinyin \u030C or 3 ↔ zhuyin \u02C7
1436 # $pToneOK{ 4 ↔ $zToneOK{ ˋ; # pinyin \u0300 or 4 ↔ zhuyin \u02CB
1437 # actually don't need context:
1438 2 ↔ ˊ; # pinyin \u0301 or 2 ↔ zhuyin \u02CA
1439 3 ↔ ˇ; # pinyin \u030C or 3 ↔ zhuyin \u02C7
1440 4 ↔ ˋ; # pinyin \u0300 or 4 ↔ zhuyin \u02CB
1442 # tone 5 (light): pinyin typically unmarked or use 5 ↔ zhuyin ˙ \u02D9
1443 ← ˙; # map to nothing
1444 5 → ˙; # transform if marked in pinyin
1445 # did the following with rules for each cluster above
1446 # → ˙; # map nothing in pinyin to zhuyin mark
1448 #--- reverse filter ----
1450 :: ([[ㄅ-ㄩ][ˉˊˇˋ˙]]); # reverse filter: only modifies basic Bopomofo and tone marks