模組:Km-pron
高棉語發音模塊。參見{{km-IPA}}
。
測試用例
Module:km-pron/testcases/data stores the testcase data.
全部測試及格。 (刷新)
文字 | 預期 | 實際 | Differs at | |
---|---|---|---|---|
ក្បាល | kɓaːl | kɓaːl | ||
ស្អែក | sʔaek | sʔaek | ||
ផ្សេង | pʰseːŋ | pʰseːŋ | ||
ល្មម | lmɔːm | lmɔːm | ||
ភ្ជុំ | pʰcum | pʰcum | ||
ម្នាស់ | mnŏəh | mnŏəh | ||
ផ្ទះ | pʰtĕəh | pʰtĕəh | ||
ខ្ញុំ | kɲom | kɲom | ||
ប្ដី | pɗəj | pɗəj | ||
ឆ្វេង | cʰʋeːŋ | cʰʋeːŋ | ||
ហ្វឹក | fək | fək | ||
ឡាន | laːn | laːn | ||
ឃាត់ | kʰŏət | kʰŏət | ||
ខាត់ | kʰat | kʰat | ||
ញាំ | ɲŏəm | ɲŏəm | ||
ល្ហុង | lhoŋ | lhoŋ | ||
សព្វ (respelling: សប់) | sɑp | sɑp | ||
អ្នក (respelling: នាក់) | nĕəʔ | nĕəʔ | ||
លក់ | lŭəʔ | lŭəʔ | ||
សង្កាត់ | sɑŋ.ˈkat | sɑŋ.ˈkat | ||
ទម្ងន់ | tum.ˈŋŭən | tum.ˈŋŭən | ||
ម្ញ៉ិកម្ញ៉ក់ | mɲək.ˈmɲɑʔ | mɲək.ˈmɲɑʔ | ||
ប្រយ័ត (respelling: ប្រយ៉ាត់) | prɑ.ˈjat | prɑ.ˈjat | ||
បារី (respelling: បារ៉ី) | ɓaː.ˈrəj | ɓaː.ˈrəj | ||
កន្លែង (respelling: កន្ល៉ែង) | kɑn.ˈlaeŋ | kɑn.ˈlaeŋ | ||
ស្រលាញ់ (respelling: ស្រ-ល៉ាញ់, ស្រ'-ល៉ាញ់) | srɑ.ˈlaɲ, srə.ˈlaɲ | srɑ.ˈlaɲ, srə.ˈlaɲ | ||
គំនិត | kum.ˈnɨt | kum.ˈnɨt | ||
ត្រជាក់ | trɑ.ˈcĕəʔ | trɑ.ˈcĕəʔ | ||
ជណ្ដើរ | cŭən.ˈɗaə | cŭən.ˈɗaə | ||
ទំហំ (respelling: ទំហ៊ំ) | tum.ˈhum | tum.ˈhum | ||
វិហារ (respelling: វិហ៊ា) | ʋi.ˈhiə | ʋi.ˈhiə | ||
បវត្តិ (respelling: ប៉ៈវ័ត) | paʔ.ˈʋŏət | paʔ.ˈʋŏət | ||
ចេតនា (respelling: ចេតៈន៉ា) | ceː.taʔ.naː | ceː.taʔ.naː | ||
វេទនា (respelling: វេទៈនា) | ʋei.tĕəʔ.niə | ʋei.tĕəʔ.niə | ||
សំស្ក្រឹត (respelling: ស័ង-ស្ក្រិត, ស័ង-សៈក្រិត) | saŋ.ˈskrət, saŋ.saʔ.krət | saŋ.ˈskrət, saŋ.saʔ.krət | ||
បន្តក់ | ɓɑn.ˈtɑʔ | ɓɑn.ˈtɑʔ | ||
សាស្ត្រា (respelling: សាស-ស្ត្រា) | saːh.ˈstraː | saːh.ˈstraː | ||
បដិសេធ (respelling: ប៉ៈដិសែត) | paʔ.ɗe.saet | paʔ.ɗe.saet | ||
បរិយោសាន (respelling: ប៉ៈរ៉ិយ៉ោសាន) | paʔ.re.jao.saːn | paʔ.re.jao.saːn | ||
ភ្នែកមាន់ (respelling: ភ្នែក មាន់) | pʰnɛːk ˈmŏən | pʰnɛːk ˈmŏən | ||
ផ្សេងៗ (respelling: ផ្សេងផ្សេង) | pʰseːŋ.ˈpʰseːŋ | pʰseːŋ.ˈpʰseːŋ | ||
កញ្ញា (respelling: ក័ញ្ញ៉ា) | kaɲ.ˈɲaː | kaɲ.ˈɲaː | ||
ភ្នំពេញ (respelling: ភ្នំ ពេញ) | pʰnum ˈpɨɲ | pʰnum ˈpɨɲ | ||
រុក្ខវិថី (respelling: រុកខៈ វិថី) | ruk.kʰaʔ ʋi.tʰəj | ruk.kʰaʔ ʋi.tʰəj | ||
សហរដ្ឋអាមេរិក (respelling: សៈហៈ រ័ត អាមេរិក) | saʔ.haʔ rŏət ʔaː.mei.rɨk | saʔ.haʔ rŏət ʔaː.mei.rɨk | ||
លលក (respelling: ល-លក) | lɔ.ˈlɔːʔ | lɔ.ˈlɔːʔ | ||
របស់ (respelling: រ-បស់, រ'-បស់) | rɔ.ˈɓɑh, rə.ˈɓɑh | rɔ.ˈɓɑh, rə.ˈɓɑh | ||
បរិភោគ (respelling: បរ៉ិភោក) | ɓɑː.re.pʰoːk | ɓɑː.re.pʰoːk | ||
ធំ (respelling: ថុំ) | tʰom | tʰom | ||
វចនានុក្រម (respelling: វៈ-ចៈ-ន៉ា-នុ-ក្រំ) | ʋĕəʔ.caʔ.naː.nu.krɑm | ʋĕəʔ.caʔ.naː.nu.krɑm | ||
សាសន (respelling: សាសៈន៉ៈ) | saː.saʔ.naʔ | saː.saʔ.naʔ | ||
សាសនា (respelling: សា-ស្នា) | saː.ˈsnaː | saː.ˈsnaː | ||
កិរិយា (respelling: កិរិយ៉ា) | ke.ri.jaː | ke.ri.jaː | ||
ល្អូកល្អិន | lʔouk.ˈlʔən | lʔouk.ˈlʔən | ||
ឆ្ងាញ់ | cʰŋaɲ | cʰŋaɲ | ||
ប្រធានាធិបតី (respelling: ប្រ់ធានាធិបប៉ៈដី) | prɑ.tʰiə.niə.tʰɨp.paʔ.ɗəj | prɑ.tʰiə.niə.tʰɨp.paʔ.ɗəj | ||
ឧសភា (respelling: អុសៈភា, អ៊ុសៈភា) | ʔo.saʔ.pʰiə, ʔu.saʔ.pʰiə | ʔo.saʔ.pʰiə, ʔu.saʔ.pʰiə | ||
ហ្វៃហ្វា (respelling: វ៉ៃ-វ៉ា, ហ្វៃ-ហ្វា) | ʋaj.ˈʋaː, faj.ˈfaː | ʋaj.ˈʋaː, faj.ˈfaː | ||
កម្មវិធី (respelling: ក័មវិធី, ក័ម្មៈវិធី, ក័ម្ម៉ៈវិធី) | kam.ʋi.tʰiː, kam.mĕəʔ.ʋi.tʰiː, kam.maʔ.ʋi.tʰiː | kam.ʋi.tʰiː, kam.mĕəʔ.ʋi.tʰiː, kam.maʔ.ʋi.tʰiː | ||
រថ (respelling: រត់) | rŭət | rŭət | ||
កម្ពុជា (respelling: ក័មពុជា) | kam.pu.ciə | kam.pu.ciə | ||
រុស្ស៊ី (respelling: រុស៊ី) | ru.ˈsiː | ru.ˈsiː | ||
ចក្រ (respelling: ច័ក, ច័ក-ក្រៈ-) | caʔ, caʔ.kraʔ. | caʔ, caʔ.kraʔ. | ||
អម្ពិល (respelling: អំពិល) | ʔɑm.ˈpɨl | ʔɑm.ˈpɨl |
文字 | 預期 | 實際 | Differs at | |
---|---|---|---|---|
ក្បាល | ក្បាល | ក្បាល | ||
ស្អែក | ស្អែក | ស្អែក | ||
ផ្សេង | ផ្សេង | ផ្សេង | ||
ល្មម | ល្មម | ល្មម | ||
ភ្ជុំ | ភ្ជុំ | ភ្ជុំ | ||
ម្នាស់ | ម្នាស់ | ម្នាស់ | ||
ផ្ទះ | ផ្ទះ | ផ្ទះ | ||
ខ្ញុំ | ខ្ញុំ | ខ្ញុំ | ||
ប្ដី | ប្ដី | ប្ដី | ||
ឆ្វេង | ឆ្វេង | ឆ្វេង | ||
ហ្វឹក | ហ្វឹក | ហ្វឹក | ||
ឡាន | ឡាន | ឡាន | ||
ឃាត់ | ឃាត់ | ឃាត់ | ||
ខាត់ | ខាត់ | ខាត់ | ||
ញាំ | ញាំ | ញាំ | ||
ល្ហុង | ល្ហុង | ល្ហុង | ||
សព្វ (respelling: សប់) | សប់ | សប់ | ||
អ្នក (respelling: នាក់) | នាក់ | នាក់ | ||
លក់ | លក់ | លក់ | ||
សង្កាត់ | ស-ង្កាត់ | ស-ង្កាត់ | ||
ទម្ងន់ | ទ-ម្ងន់ | ទ-ម្ងន់ | ||
ម្ញ៉ិកម្ញ៉ក់ | ម្ញ៉ិក-ម្ញ៉ក់ | ម្ញ៉ិក-ម្ញ៉ក់ | ||
ប្រយ័ត (respelling: ប្រយ៉ាត់) | ប្រ-យ៉ាត់ | ប្រ-យ៉ាត់ | ||
បារី (respelling: បារ៉ី) | បា-រ៉ី | បា-រ៉ី | ||
កន្លែង (respelling: កន្ល៉ែង) | ក-ន្ល៉ែង | ក-ន្ល៉ែង | ||
ស្រលាញ់ (respelling: ស្រ-ល៉ាញ់, ស្រ'-ល៉ាញ់) | ស្រ-ល៉ាញ់, ស្រ'-ល៉ាញ់ | ស្រ-ល៉ាញ់, ស្រ'-ល៉ាញ់ | ||
គំនិត | គំ-និត | គំ-និត | ||
ត្រជាក់ | ត្រ-ជាក់ | ត្រ-ជាក់ | ||
ជណ្ដើរ | ជ-ណ្ដើរ | ជ-ណ្ដើរ | ||
ទំហំ (respelling: ទំហ៊ំ) | ទំ-ហ៊ំ | ទំ-ហ៊ំ | ||
វិហារ (respelling: វិហ៊ា) | វិ-ហ៊ា | វិ-ហ៊ា | ||
បវត្តិ (respelling: ប៉ៈវ័ត) | ប៉ៈ-វ័ត | ប៉ៈ-វ័ត | ||
ចេតនា (respelling: ចេតៈន៉ា) | ចេ-តៈ-ន៉ា | ចេ-តៈ-ន៉ា | ||
វេទនា (respelling: វេទៈនា) | វេ-ទៈ-នា | វេ-ទៈ-នា | ||
សំស្ក្រឹត (respelling: ស័ង-ស្ក្រិត, ស័ង-សៈក្រិត) | ស័ង-ស្ក្រិត, ស័ង-សៈ-ក្រិត | ស័ង-ស្ក្រិត, ស័ង-សៈ-ក្រិត | ||
បន្តក់ | ប-ន្តក់ | ប-ន្តក់ | ||
សាស្ត្រា (respelling: សាស-ស្ត្រា) | សាស-ស្ត្រា | សាស-ស្ត្រា | ||
បដិសេធ (respelling: ប៉ៈដិសែត) | ប៉ៈ-ដិ-សែត | ប៉ៈ-ដិ-សែត | ||
បរិយោសាន (respelling: ប៉ៈរ៉ិយ៉ោសាន) | ប៉ៈ-រ៉ិ-យ៉ោ-សាន | ប៉ៈ-រ៉ិ-យ៉ោ-សាន | ||
ភ្នែកមាន់ (respelling: ភ្នែក មាន់) | ភ្នែក មាន់ | ភ្នែក មាន់ | ||
ផ្សេងៗ (respelling: ផ្សេងផ្សេង) | ផ្សេង-ផ្សេង | ផ្សេង-ផ្សេង | ||
កញ្ញា (respelling: ក័ញ្ញ៉ា) | ក័-ញ្ញ៉ា | ក័-ញ្ញ៉ា | ||
ភ្នំពេញ (respelling: ភ្នំ ពេញ) | ភ្នំ ពេញ | ភ្នំ ពេញ | ||
រុក្ខវិថី (respelling: រុកខៈ វិថី) | រុក-ខៈ វិ-ថី | រុក-ខៈ វិ-ថី | ||
សហរដ្ឋអាមេរិក (respelling: សៈហៈ រ័ត អាមេរិក) | សៈ-ហៈ រ័ត អា-មេ-រិក | សៈ-ហៈ រ័ត អា-មេ-រិក | ||
លលក (respelling: ល-លក) | ល-លក | ល-លក | ||
របស់ (respelling: រ-បស់, រ'-បស់) | រ-បស់, រ'-បស់ | រ-បស់, រ'-បស់ | ||
បរិភោគ (respelling: បរ៉ិភោក) | ប-រ៉ិ-ភោក | ប-រ៉ិ-ភោក | ||
ធំ (respelling: ថុំ) | ថុំ | ថុំ | ||
វចនានុក្រម (respelling: វៈ-ចៈ-ន៉ា-នុ-ក្រំ) | វៈ-ចៈ-ន៉ា-នុ-ក្រំ | វៈ-ចៈ-ន៉ា-នុ-ក្រំ | ||
សាសន (respelling: សាសៈន៉ៈ) | សា-សៈ-ន៉ៈ | សា-សៈ-ន៉ៈ | ||
សាសនា (respelling: សា-ស្នា) | សា-ស្នា | សា-ស្នា | ||
កិរិយា (respelling: កិរិយ៉ា) | កិ-រិ-យ៉ា | កិ-រិ-យ៉ា | ||
ល្អូកល្អិន | ល្អូក-ល្អិន | ល្អូក-ល្អិន | ||
ឆ្ងាញ់ | ឆ្ងាញ់ | ឆ្ងាញ់ | ||
ប្រធានាធិបតី (respelling: ប្រ់ធានាធិបប៉ៈដី) | ប្រ់-ធា-នា-ធិប-ប៉ៈ-ដី | ប្រ់-ធា-នា-ធិប-ប៉ៈ-ដី | ||
ឧសភា (respelling: អុសៈភា, អ៊ុសៈភា) | អុ-សៈ-ភា, អ៊ុ-សៈ-ភា | អុ-សៈ-ភា, អ៊ុ-សៈ-ភា | ||
ហ្វៃហ្វា (respelling: វ៉ៃ-វ៉ា, ហ្វៃ-ហ្វា) | វ៉ៃ-វ៉ា, ហ្វៃ-ហ្វា | វ៉ៃ-វ៉ា, ហ្វៃ-ហ្វា | ||
កម្មវិធី (respelling: ក័មវិធី, ក័ម្មៈវិធី, ក័ម្ម៉ៈវិធី) | ក័ម-វិ-ធី, ក័-ម្មៈ-វិ-ធី, ក័-ម្ម៉ៈ-វិ-ធី | ក័ម-វិ-ធី, ក័-ម្មៈ-វិ-ធី, ក័-ម្ម៉ៈ-វិ-ធី | ||
រថ (respelling: រត់) | រត់ | រត់ | ||
កម្ពុជា (respelling: ក័មពុជា) | ក័ម-ពុ-ជា | ក័ម-ពុ-ជា | ||
រុស្ស៊ី (respelling: រុស៊ី) | រុ-ស៊ី | រុ-ស៊ី | ||
ចក្រ (respelling: ច័ក, ច័ក-ក្រៈ-) | ច័ក, ច័ក-ក្រៈ- | ច័ក, ច័ក-ក្រៈ- | ||
អម្ពិល (respelling: អំពិល) | អំ-ពិល | អំ-ពិល |
文字 | 預期 | 實際 | Differs at | |
---|---|---|---|---|
ក្បាល | kbaal | kbaal | ||
ស្អែក | sʾaek | sʾaek | ||
ផ្សេង | phseeng | phseeng | ||
ល្មម | lmɔɔm | lmɔɔm | ||
ភ្ជុំ | phcum | phcum | ||
ម្នាស់ | mnŏəh | mnŏəh | ||
ផ្ទះ | phtĕəh | phtĕəh | ||
ខ្ញុំ | khñom | khñom | ||
ប្ដី | pdəy | pdəy | ||
ឆ្វេង | chveeng | chveeng | ||
ហ្វឹក | fək | fək | ||
ឡាន | laan | laan | ||
ឃាត់ | khŏət | khŏət | ||
ខាត់ | khat | khat | ||
ញាំ | ñŏəm | ñŏəm | ||
ល្ហុង | lhong | lhong | ||
សព្វ (respelling: សប់) | sɑp | sɑp | ||
អ្នក (respelling: នាក់) | nĕək | nĕək | ||
លក់ | lŭək | lŭək | ||
សង្កាត់ | sɑngkat | sɑngkat | ||
ទម្ងន់ | tumngŭən | tumngŭən | ||
ម្ញ៉ិកម្ញ៉ក់ | mñəkmñɑk | mñəkmñɑk | ||
ប្រយ័ត (respelling: ប្រយ៉ាត់) | prɑyat | prɑyat | ||
បារី (respelling: បារ៉ី) | baarəy | baarəy | ||
កន្លែង (respelling: កន្ល៉ែង) | kɑnlaeng | kɑnlaeng | ||
ស្រលាញ់ (respelling: ស្រ-ល៉ាញ់, ស្រ'-ល៉ាញ់) | srɑlañ, srəlañ | srɑlañ, srəlañ | ||
គំនិត | kumnɨt | kumnɨt | ||
ត្រជាក់ | trɑcĕək | trɑcĕək | ||
ជណ្ដើរ | cŭəndaə | cŭəndaə | ||
ទំហំ (respelling: ទំហ៊ំ) | tumhum | tumhum | ||
វិហារ (respelling: វិហ៊ា) | vihiə | vihiə | ||
បវត្តិ (respelling: ប៉ៈវ័ត) | paʾvŏət | paʾvŏət | ||
ចេតនា (respelling: ចេតៈន៉ា) | ceetaʾnaa | ceetaʾnaa | ||
វេទនា (respelling: វេទៈនា) | veitĕəʾniə | veitĕəʾniə | ||
សំស្ក្រឹត (respelling: ស័ង-ស្ក្រិត, ស័ង-សៈក្រិត) | sangskrət, sangsaʾkrət | sangskrət, sangsaʾkrət | ||
បន្តក់ | bɑntɑk | bɑntɑk | ||
សាស្ត្រា (respelling: សាស-ស្ត្រា) | saahstraa | saahstraa | ||
បដិសេធ (respelling: ប៉ៈដិសែត) | paʾdesaet | paʾdesaet | ||
បរិយោសាន (respelling: ប៉ៈរ៉ិយ៉ោសាន) | paʾreyaosaan | paʾreyaosaan | ||
ភ្នែកមាន់ (respelling: ភ្នែក មាន់) | phnɛɛk mŏən | phnɛɛk mŏən | ||
ផ្សេងៗ (respelling: ផ្សេងផ្សេង) | phseengphseeng | phseengphseeng | ||
កញ្ញា (respelling: ក័ញ្ញ៉ា) | kaññaa | kaññaa | ||
ភ្នំពេញ (respelling: ភ្នំ ពេញ) | phnum pɨñ | phnum pɨñ | ||
រុក្ខវិថី (respelling: រុកខៈ វិថី) | rukkhaʾ vithəy | rukkhaʾ vithəy | ||
សហរដ្ឋអាមេរិក (respelling: សៈហៈ រ័ត អាមេរិក) | saʾhaʾ rŏət ʾaameirɨk | saʾhaʾ rŏət ʾaameirɨk | ||
លលក (respelling: ល-លក) | lɔlɔɔk | lɔlɔɔk | ||
របស់ (respelling: រ-បស់, រ'-បស់) | rɔbɑh, rəbɑh | rɔbɑh, rəbɑh | ||
បរិភោគ (respelling: បរ៉ិភោក) | bɑɑrephook | bɑɑrephook | ||
ធំ (respelling: ថុំ) | thom | thom | ||
វចនានុក្រម (respelling: វៈ-ចៈ-ន៉ា-នុ-ក្រំ) | vĕəʾcaʾnaanukrɑm | vĕəʾcaʾnaanukrɑm | ||
សាសន (respelling: សាសៈន៉ៈ) | saasaʾnaʾ | saasaʾnaʾ | ||
សាសនា (respelling: សា-ស្នា) | saasnaa | saasnaa | ||
កិរិយា (respelling: កិរិយ៉ា) | keriyaa | keriyaa | ||
ល្អូកល្អិន | lʾouklʾən | lʾouklʾən | ||
ឆ្ងាញ់ | chngañ | chngañ | ||
ប្រធានាធិបតី (respelling: ប្រ់ធានាធិបប៉ៈដី) | prɑthiəniəthɨppaʾdəy | prɑthiəniəthɨppaʾdəy | ||
ឧសភា (respelling: អុសៈភា, អ៊ុសៈភា) | ʾosaʾphiə, ʾusaʾphiə | ʾosaʾphiə, ʾusaʾphiə | ||
ហ្វៃហ្វា (respelling: វ៉ៃ-វ៉ា, ហ្វៃ-ហ្វា) | vayvaa, fayfaa | vayvaa, fayfaa | ||
កម្មវិធី (respelling: ក័មវិធី, ក័ម្មៈវិធី, ក័ម្ម៉ៈវិធី) | kamvithii, kammĕəʾvithii, kammaʾvithii | kamvithii, kammĕəʾvithii, kammaʾvithii | ||
រថ (respelling: រត់) | rŭət | rŭət | ||
កម្ពុជា (respelling: ក័មពុជា) | kampuciə | kampuciə | ||
រុស្ស៊ី (respelling: រុស៊ី) | rusii | rusii | ||
ចក្រ (respelling: ច័ក, ច័ក-ក្រៈ-) | cak, cakkraʾ | cak, cakkraʾ | ||
អម្ពិល (respelling: អំពិល) | ʾɑmpɨl | ʾɑmpɨl |
-- To do: add stress in words with >2 syllables (primary and secondary)
--- Reference: 'Research report on phonetic and phonological analysis of Khmer'
--- http://www.panl10n.net/english/Outputs%20Phase%202/CCs/Cambodia/ITC/Papers/2007/0701/phonetic-and-phonological-analysis.pdf
--- Algorithm is simple, though may be inaccurate when automatically applied to multisyllabic words, as some can be 'romanised' in dictionaries as if they are one word but have stress patterns indicating otherwise
--- e.g. [[ប្រជាប្រិយ]]
local export = {}
local gsub = mw.ustring.gsub
local find = mw.ustring.find
local match = mw.ustring.match
local len = mw.ustring.len
local pagename = mw.title.getCurrentTitle().text
local j = "្"
local c = "កខគឃងចឆជឈញដឋឌឍណតថទធនបផពភមយរលវឝឞសហឡអ"
local cMod = "៉៊"
local vIndep = "ឣឤឥឦឧឨឩឪឫឬឭឮឯឰឱឲឳ"
local vDiac = "ាិីឹឺុូួើឿៀេែៃោៅំះៈ័"
local vPost = "់"
local apos = "'"
local kmChar = "ក-៹'"
local kmString = "[" .. kmChar .. "]+"
local recessive = "[ŋɲñnmjrlʋv]"
local cCapt, cUncapt = "([" .. c .. "][" .. cMod .. "]?)", "[" .. c .. "][" .. cMod .. "]?"
local cOptCapt = "([" .. c .. "]?[" .. cMod .. "]?)"
local cCaptClus = {
"([" .. c .. "][" .. cMod .. "]?)",
"([" .. c .. "][" .. cMod .. "]?" .. j .. cUncapt .. ")",
"([" .. c .. "][" .. cMod .. "]?" .. j .. cUncapt .. j .. cUncapt .. ")",
"([" .. c .. "][" .. cMod .. "]?" .. j .. cUncapt .. j .. cUncapt .. j .. cUncapt .. ")"
}
local vCapt, vCaptB, vCaptM = "([" .. vDiac .. "])", "([" .. vDiac .. j .. "])", "([" .. vDiac .. "]*)"
local cvCapt = "([" .. c .. cMod .. vDiac .. "])"
local vPostCapt = "([" .. vPost .. "]?)"
local postInit = vCaptM .. cOptCapt .. vPostCapt .. "(" .. apos .. "?)"
local consonants = {
["ក"] = { class = 1, ["ipa"] = { "k", "k" }, ["tc"] = { "k", "k" } },
["ខ"] = { class = 1, ["ipa"] = { "kʰ", "k" }, ["tc"] = { "kh", "k" } },
["គ"] = { class = 2, ["ipa"] = { "k", "k" }, ["tc"] = { "k", "k" } },
["ឃ"] = { class = 2, ["ipa"] = { "kʰ", "k" }, ["tc"] = { "kh", "k" } },
["ង"] = { class = 2, ["ipa"] = { "ŋ", "ŋ" }, ["tc"] = { "ng", "ng" } },
["ង៉"] = { class = 1, ["ipa"] = { "ŋ", "ŋ" }, ["tc"] = { "ng", "ng" } },
["ច"] = { class = 1, ["ipa"] = { "c", "c" }, ["tc"] = { "c", "c" } },
["ឆ"] = { class = 1, ["ipa"] = { "cʰ", "c" }, ["tc"] = { "ch", "c" } },
["ជ"] = { class = 2, ["ipa"] = { "c", "c" }, ["tc"] = { "c", "c" } },
["ឈ"] = { class = 2, ["ipa"] = { "cʰ", "c" }, ["tc"] = { "ch", "c" } },
["ញ"] = { class = 2, ["ipa"] = { "ɲ", "ɲ" }, ["tc"] = { "ñ", "ñ" } },
["ញ៉"] = { class = 1, ["ipa"] = { "ɲ", "ɲ" }, ["tc"] = { "ñ", "ñ" } },
["ដ"] = { class = 1, ["ipa"] = { "ɗ", "t" }, ["tc"] = { "d", "t" } },
["ឋ"] = { class = 1, ["ipa"] = { "tʰ", "t" }, ["tc"] = { "th", "t" } },
["ឌ"] = { class = 2, ["ipa"] = { "ɗ", "t" }, ["tc"] = { "d", "t" } },
["ឍ"] = { class = 2, ["ipa"] = { "tʰ", "t" }, ["tc"] = { "th", "t" } },
["ណ"] = { class = 1, ["ipa"] = { "n", "n" }, ["tc"] = { "n", "n" } },
["ត"] = { class = 1, ["ipa"] = { "t", "t" }, ["tc"] = { "t", "t" } },
["ថ"] = { class = 1, ["ipa"] = { "tʰ", "t" }, ["tc"] = { "th", "t" } },
["ទ"] = { class = 2, ["ipa"] = { "t", "t" }, ["tc"] = { "t", "t" } },
["ធ"] = { class = 2, ["ipa"] = { "tʰ", "t" }, ["tc"] = { "th", "t" } },
["ន"] = { class = 2, ["ipa"] = { "n", "n" }, ["tc"] = { "n", "n" } },
["ន៉"] = { class = 1, ["ipa"] = { "n", "n" }, ["tc"] = { "n", "n" } },
["ប"] = { class = 1, ["ipa"] = { "ɓ", "p" }, ["tc"] = { "b", "p" } },
["ប៉"] = { class = 1, ["ipa"] = { "p", "p" }, ["tc"] = { "p", "p" } },
["ប៊"] = { class = 2, ["ipa"] = { "ɓ", "p" }, ["tc"] = { "b", "p" } },
["ផ"] = { class = 1, ["ipa"] = { "pʰ", "p" }, ["tc"] = { "ph", "p" } },
["ព"] = { class = 2, ["ipa"] = { "p", "p" }, ["tc"] = { "p", "p" } },
["ភ"] = { class = 2, ["ipa"] = { "pʰ", "p" }, ["tc"] = { "ph", "p" } },
["ម"] = { class = 2, ["ipa"] = { "m", "m" }, ["tc"] = { "m", "m" } },
["ម៉"] = { class = 1, ["ipa"] = { "m", "m" }, ["tc"] = { "m", "m" } },
["យ"] = { class = 2, ["ipa"] = { "j", "j" }, ["tc"] = { "y", "y" } },
["យ៉"] = { class = 1, ["ipa"] = { "j", "j" }, ["tc"] = { "y", "y" } },
["រ"] = { class = 2, ["ipa"] = { "r", "" }, ["tc"] = { "r", "" } },
["រ៉"] = { class = 1, ["ipa"] = { "r", "" }, ["tc"] = { "r", "" } },
["ល"] = { class = 2, ["ipa"] = { "l", "l" }, ["tc"] = { "l", "l" } },
["ល៉"] = { class = 1, ["ipa"] = { "l", "l" }, ["tc"] = { "l", "l" } },
["វ"] = { class = 2, ["ipa"] = { "ʋ", "w" }, ["tc"] = { "v", "w" } },
["វ៉"] = { class = 1, ["ipa"] = { "ʋ", "w" }, ["tc"] = { "v", "w" } },
["ឝ"] = { class = 1, ["ipa"] = { "s", "h" }, ["tc"] = { "s", "h" } },
["ឞ"] = { class = 1, ["ipa"] = { "s", "h" }, ["tc"] = { "s", "h" } },
["ស"] = { class = 1, ["ipa"] = { "s", "h" }, ["tc"] = { "s", "h" } },
["ស៊"] = { class = 2, ["ipa"] = { "s", "h" }, ["tc"] = { "s", "h" } },
["ហ"] = { class = 1, ["ipa"] = { "h", "h" }, ["tc"] = { "h", "h" } },
["ហ៊"] = { class = 2, ["ipa"] = { "h", "h" }, ["tc"] = { "h", "h" } },
["ឡ"] = { class = 1, ["ipa"] = { "l", "l" }, ["tc"] = { "l", "l" } },
["អ"] = { class = 1, ["ipa"] = { "ʔ", "" }, ["tc"] = { "ʾ", "ʾ" } },
["អ៊"] = { class = 2, ["ipa"] = { "ʔ", "" }, ["tc"] = { "ʾ", "ʾ" } },
["ហគ"] = { class = 1, ["ipa"] = { "ɡ", "k" }, ["tc"] = { "g", "k" } },
["ហគ៊"] = { class = 2, ["ipa"] = { "ɡ", "k" }, ["tc"] = { "g", "k" } },
["ហ៊គ"] = { class = 2, ["ipa"] = { "ɡ", "k" }, ["tc"] = { "g", "k" } },
["ហន"] = { class = 1, ["ipa"] = { "n", "" }, ["tc"] = { "n", "n" } },
["ហម"] = { class = 1, ["ipa"] = { "m", "" }, ["tc"] = { "m", "m" } },
["ហល"] = { class = 1, ["ipa"] = { "l", "" }, ["tc"] = { "l", "l" } },
["ហវ"] = { class = 1, ["ipa"] = { "f", "f" }, ["tc"] = { "f", "f" } },
["ហវ៊"] = { class = 2, ["ipa"] = { "f", "f" }, ["tc"] = { "f", "f" } },
["ហ៊វ"] = { class = 2, ["ipa"] = { "f", "f" }, ["tc"] = { "f", "f" } },
["ហស"] = { class = 1, ["ipa"] = { "z", "z" }, ["tc"] = { "z", "z" } },
["ហស៊"] = { class = 2, ["ipa"] = { "z", "z" }, ["tc"] = { "z", "z" } },
["ហ៊ស"] = { class = 2, ["ipa"] = { "z", "z" }, ["tc"] = { "z", "z" } },
[""] = { class = 1, ["ipa"] = { "", "" }, ["tc"] = { "", "" } },
}
local vowels = {
[""] = { ["ipa"] = { "ɑː", "ɔː" }, ["tc"] = { "ɑɑ", "ɔɔ" } },
["់"] = { ["ipa"] = { "ɑ", "ŭə" }, ["tc"] = { "ɑ", "ŭə" } },
["់2"] = { ["ipa"] = { "ɑ", "u" }, ["tc"] = { "ɑ", "u" } }, --before labial finals
["័"] = { ["ipa"] = { "a", "ŏə" }, ["tc"] = { "a", "ŏə" } },
["័2"] = { ["ipa"] = { "a", "ĕə" }, ["tc"] = { "a", "ĕə" } }, --before velar finals
["័យ"] = { ["ipa"] = { "aj", "ɨj" }, ["tc"] = { "ay", "ɨy" } },
["័រ"] = { ["ipa"] = { "", "ɔə" }, ["tc"] = { "", "ɔə" } },
["ា"] = { ["ipa"] = { "aː", "iə" }, ["tc"] = { "aa", "iə" } },
["ា់"] = { ["ipa"] = { "a", "ŏə" }, ["tc"] = { "a", "ŏə" } },
["ា់2"] = { ["ipa"] = { "a", "ĕə" }, ["tc"] = { "a", "ĕə" } }, --before velar finals
["ិ"] = { ["ipa"] = { "eʔ", "iʔ" }, ["tc"] = { "eʾ", "iʾ" } }, --glottal coda only in stressed syllables
["ិ2"] = { ["ipa"] = { "ə", "ɨ" }, ["tc"] = { "ə", "ɨ" } }, --with non-glottal coda
["ិយ"] = { ["ipa"] = { "əj", "iː" }, ["tc"] = { "əy", "ii" } },
["ិះ"] = { ["ipa"] = { "eh", "ih" }, ["tc"] = { "eh", "ih" } }, --["tc"] inferred
["ី"] = { ["ipa"] = { "əj", "iː" }, ["tc"] = { "əy", "ii" } },
["ឹ"] = { ["ipa"] = { "ə", "ɨ" }, ["tc"] = { "ə", "ɨ" } },
["ឹះ"] = { ["ipa"] = { "əh", "" }, ["tc"] = { "əh", "" } },
["ឺ"] = { ["ipa"] = { "əɨ", "ɨː" }, ["tc"] = { "əɨ", "ɨɨ" } },
["ុ"] = { ["ipa"] = { "oʔ", "uʔ" }, ["tc"] = { "oʾ", "uʾ" } }, --glottal coda only in stressed syllables
["ុ2"] = { ["ipa"] = { "o", "u" }, ["tc"] = { "o", "u" }}, --with non-glottal coda
["ុះ"] = { ["ipa"] = { "oh", "uh" }, ["tc"] = { "oh", "uh" } },
["ូ"] = { ["ipa"] = { "ou", "uː" }, ["tc"] = { "ou", "uu" } },
["ូវ"] = { ["ipa"] = { "əw", "ɨw" }, ["tc"] = { "əw", "ɨw" } },
["ួ"] = { ["ipa"] = { "uə", "uə" }, ["tc"] = { "uə", "uə" } },
["ើ"] = { ["ipa"] = { "aə", "əː" }, ["tc"] = { "aə", "əə" } },
["ើះ"] = { ["ipa"] = { "əh", "" }, ["tc"] = { "əh", "" } },
["ឿ"] = { ["ipa"] = { "ɨə", "ɨə" }, ["tc"] = { "ɨə", "ɨə" } },
["ៀ"] = { ["ipa"] = { "iə", "iə" }, ["tc"] = { "iə", "iə" } },
["េ"] = { ["ipa"] = { "eː", "ei" }, ["tc"] = { "ee", "ei" } },
["េ2"] = { ["ipa"] = { "ə", "ɨ" }, ["tc"] = { "ə", "ɨ" } }, --before palatals
["េះ"] = { ["ipa"] = { "eh", "ih" }, ["tc"] = { "eh", "ih" } },
["ែ"] = { ["ipa"] = { "ae", "ɛː" }, ["tc"] = { "ae", "ɛɛ" } },
["ែះ"] = { ["ipa"] = { "eh", "" }, ["tc"] = { "eh", "" } },
["ៃ"] = { ["ipa"] = { "aj", "ɨj" }, ["tc"] = { "ay", "ɨy" } },
["ោ"] = { ["ipa"] = { "ao", "oː" }, ["tc"] = { "ao", "oo" } },
["ោះ"] = { ["ipa"] = { "ɑh", "ŭəh" }, ["tc"] = { "ɑh", "ŭəh" } },
["ៅ"] = { ["ipa"] = { "aw", "ɨw" }, ["tc"] = { "aw", "ɨw" } },
["ុំ"] = { ["ipa"] = { "om", "um" }, ["tc"] = { "om", "um" } },
["ំ"] = { ["ipa"] = { "ɑm", "um" }, ["tc"] = { "ɑm", "um" } },
["ាំ"] = { ["ipa"] = { "am", "ŏəm" }, ["tc"] = { "am", "ŏəm" } },
["ាំង"] = { ["ipa"] = { "aŋ", "ĕəŋ" }, ["tc"] = { "ang", "ĕəng" } },
["ះ"] = { ["ipa"] = { "ah", "ĕəh" }, ["tc"] = { "ah", "ĕəh" } },
["ៈ"] = { ["ipa"] = { "aʔ", "ĕəʔ" }, ["tc"] = { "aʾ", "ĕəʾ" } },
["'"] = { ["ipa"] = { "ə", "ə" }, ["tc"] = { "ə", "ə" } },
}
local tl = {
["ក"] = "k", ["ខ"] = "kʰ", ["គ"] = "g", ["ឃ"] = "gʰ", ["ង"] = "ṅ",
["ច"] = "c", ["ឆ"] = "cʰ", ["ជ"] = "j", ["ឈ"] = "jʰ", ["ញ"] = "ñ",
["ដ"] = "ṭ", ["ឋ"] = "ṭʰ", ["ឌ"] = "ḍ", ["ឍ"] = "ḍʰ", ["ណ"] = "ṇ",
["ត"] = "t", ["ថ"] = "tʰ", ["ទ"] = "d", ["ធ"] = "dʰ", ["ន"] = "n",
["ប"] = "p", ["ផ"] = "pʰ", ["ព"] = "b", ["ភ"] = "bʰ", ["ម"] = "m",
["យ"] = "y", ["រ"] = "r", ["ល"] = "l", ["វ"] = "v",
["ឝ"] = "ś", ["ឞ"] = "ṣ", ["ស"] = "s",
["ហ"] = "h", ["ឡ"] = "ḷ", ["អ"] = "ʾ",
["ឣ"] = "a", ["ឤ"] = "ā", ["ឥ"] = "i", ["ឦ"] = "ī",
["ឧ"] = "u", ["ឨ"] = "🤷", ["ឩ"] = "ū", ["ឪ"] = "ýu",
["ឫ"] = "ṛ", ["ឬ"] = "ṝ", ["ឭ"] = "ḷ", ["ឮ"] = "ḹ",
["ឯ"] = "ae", ["ឰ"] = "ai", ["ឱ"] = "o", ["ឲ"] = "o", ["ឳ"] = "au",
["ា"] = "ā", ["ិ"] = "i", ["ី"] = "ī", ["ឹ"] = "ẏ", ["ឺ"] = "ȳ",
["ុ"] = "u", ["ូ"] = "ū", ["ួ"] = "ua",
["ើ"] = "oe", ["ឿ"] = "ẏa", ["ៀ"] = "ia",
["េ"] = "e", ["ែ"] = "ae", ["ៃ"] = "ai", ["ោ"] = "o", ["ៅ"] = "au",
["ំ"] = "ṃ", ["ះ"] = "ḥ", ["ៈ"] = "`",
["៉"] = "″", ["៊"] = "′", ["់"] = "´", ["៌"] = "ŕ", ["៍"] = "̊",
["៎"] = "⸗", ["៏"] = "ʿ", ["័"] = "˘", ["៑"] = "̑", ["្"] = "̥",
["៓"] = "🤷", ["។"] = "ǂ", ["៕"] = "ǁ", ["៖"] = "🤷", ["ៗ"] = "«",
["៘"] = "🤷", ["៙"] = "§", ["៚"] = "»", ["៛"] = "",
["ៜ"] = "🤷", ["៝"] = "🤷",
["០"] = "0", ["១"] = "1", ["២"] = "2", ["៣"] = "3", ["៤"] = "4",
["៥"] = "5", ["៦"] = "6", ["៧"] = "7", ["៨"] = "8", ["៩"] = "9",
["៰"] = "🤷", ["៱"] = "🤷", ["៲"] = "🤷", ["៳"] = "🤷", ["៴"] = "🤷",
["៵"] = "🤷", ["៶"] = "🤷", ["៷"] = "🤷", ["៸"] = "🤷", ["៹"] = "🤷",
}
local glottify = {
["a"] = 1, ["aː"] = 1, ["ɑ"] = 1, ["ɑː"] = 1, ["ɔ"] = 1, ["ɔː"] = 1,
["ĕə"] = 1, ["ŭə"] = 1, ["iə"] = 1, ["ɨə"] = 1, ["uə"] = 1
}
local err = {
["័"] = 1, ["័រ"] = 1,
}
local ambig = {
["k%-h"] = "kh", ["c%-h"] = "ch", ["t%-h"] = "th", ["p%-h"] = "ph",
["n%-g"] = "ng",
}
function export.syllabify(text)
text = gsub(text, "([%'់])([^,%- ])", "%1-%2")
local seq1 = cvCapt .. cCapt .. vCaptB
while find(text, seq1) do text = gsub(text, seq1, "%1-%2%3") end
return text
end
function export.syl_analysis(syllable)
for ind = 4, 1, -1 do
if match(syllable, "^" .. cCaptClus[ind] .. postInit .. "$") then
return match(syllable, "^" .. cCaptClus[ind] .. postInit .. "$")
end
end
return nil
end
local function sylRedist(text, block)
for word in mw.ustring.gmatch(text, "[" .. kmChar .. "%-]+") do
local originalWord = word
local allSyl, syls, newWord = {}, mw.text.split(word, "%-"), {}
for sylId = 1, #syls do
if syls[sylId] == "" then table.insert(allSyl, {})
else
local set = export.syl_analysis(syls[sylId])
if not set or set == "" then return nil end
table.insert(allSyl, { export.syl_analysis(syls[sylId]) })
if sylId ~= 1 and allSyl[sylId - 1][3] == "" and find(allSyl[sylId][1], j) and not block then
allSyl[sylId - 1][3], allSyl[sylId][1] =
match(allSyl[sylId][1], "^([^" .. j .. "]+)"),
match(allSyl[sylId][1], "^[^" .. j .. "]+" .. j .. "(.+)")
end
if #syls == 2 and sylId == 2 and allSyl[sylId - 1][2] .. allSyl[sylId - 1][4] == "" then
allSyl[sylId - 1][4] = vPost
end
end
end
for sylId = 1, #syls do
table.insert(newWord, table.concat(allSyl[sylId]))
end
text = gsub(text, (gsub(originalWord, "%-", "%-")), table.concat(newWord, "%-"), 1)
end
return text
end
local function getCons(c1Set)
c1l, i, consSet = #c1Set, 1, {}
while i < c1l + 1 do
for j = 3, 1, -1 do
local conss = i + j - 1 > c1l and "a" or table.concat(c1Set, "", i, i + j - 1)
if consonants[conss] then
table.insert(consSet, conss)
i = i + j
break
end
if j == 1 then return nil end
end
end
return consSet
end
local function initClus(c1, mode)
local fittest, init, cData, pos = "", {}, {}, 1
c1 = gsub(c1, j, "")
if consonants[c1] then
local cData = consonants[c1]
c1, fittest = cData[mode][pos], cData.class
else
local consSet = getCons(mw.text.split(c1, ""))
if not consSet then return error("Error handling initial " .. c1 .. ".") end
for seq, ch in ipairs(consSet) do
local cData = consonants[ch]
fittest = (not find(cData[mode][pos], recessive) and not find(cData[mode][pos], "ng")
or (fittest == "" and seq == #consSet))
and cData.class or fittest
table.insert(init, cData[mode][pos])
end
c1 = table.concat(init)
end
c1 = gsub(c1, "[ɓb](.)", "p%1")
c1 = gsub(c1, "[ɗd](.)", "t%1")
if mode == "ipa" then
c1 = gsub(c1, "p([knŋcɲdtnjls])", "pʰ%1")
c1 = gsub(c1, "pʰ([^knŋcɲdtnjls])", "p%1")
c1 = gsub(c1, "t([kŋnmjlʋ])", "tʰ%1")
c1 = gsub(c1, "tʰ([^kŋnmjlʋ])", "t%1")
c1 = gsub(c1, "k([ctnbmlʋs])", "kʰ%1")
c1 = gsub(c1, "kʰ([^ctnbmlʋs])", "k%1")
c1 = gsub(c1, "c([kŋnmlʋʔ])", "cʰ%1")
c1 = gsub(c1, "cʰ([^kŋnmlʋʔ])", "c%1")
end
return c1, fittest
end
local function rime(v1, c2, fittest, red, mode)
if red == apos then v1 = red end
if vowels[v1 .. c2] then return vowels[v1 .. c2][mode][fittest] end
c2 = consonants[c2][mode][2] or c2
if ((v1 == "័" or v1 == "ា់") and (find(c2, "[kŋ]") or c2 == "ng")) or
(v1 == "េ" and (find(c2, "[cɲ]") or c2 == "ñ")) or
(v1 == "់" and find(c2, "[mp]")) or
((v1 == "ិ" or v1 == "ុ") and c2 ~= "") then
v1 = v1 .. "2"
end
v1 = vowels[v1] and vowels[v1][mode][fittest] or v1
if (glottify[v1] and mode == "ipa") and c2 == "k" then c2 = "ʡ" end --proxy
return v1 .. c2
end
function export.convert(text, mode, source)
block = find(text, "%-")
text = sylRedist(export.syllabify(text), block)
if not text then return nil end
for syllable in mw.ustring.gmatch(text, kmString) do
local unchanged, sylStruc = syllable, {}
local c1, v1, c2, bantak, red = export.syl_analysis(syllable)
if not c1 then return nil end
c1, fittest = initClus(c1, mode)
if source == "temp" and (err[v1..c2] or err[v1]) then
require("Module:debug").track("km-pron/error-prone finals")
end
v1c2 = rime(v1 .. bantak, c2, fittest, red, mode)
if not v1c2 then return nil end
text = gsub(text, unchanged, c1 .. v1c2, 1)
end
text = gsub(text, "(.%%%-.)", ambig)
text = gsub(text, "%%", "")
text = gsub(text, "%-", ".")
text = gsub(text, "", "-")
text = gsub(text, "ʔ([ptkhlɲŋmnjw])", "%1")
text = gsub(text, "ŭə%.", "ɔ.")
text = gsub(text, "([eiou])[ʔʾ]%.", "%1.")
text = gsub(text, "ʡ%.s", "k.s")
text = gsub(text, "ʡ", "ʔ")
if mode == "tc" then
text = gsub(text, "%.%.%.", "…")
text = gsub(text, "%.", "")
else
text = gsub(text, "%-", ".")
local readings = {}
for reading in mw.text.gsplit(text, ", ") do
table.insert(readings, (gsub(reading, "^([^%.]+)%.([^%.]+)$", "%1.ˈ%2")))
end
text = table.concat(readings, ", ")
text = gsub(text, "^([^%. ]+) ([^%. ]+)$", "%1 ˈ%2")
end
return text
end
local function return_error()
return error("The entry title or respelling contains zero-space width character. Please remove it.")
end
function export.make(frame)
local params = {
[1] = { list = true },
["a"] = {},
["audio"] = { alias_of = "a" },
["word"] = { default = pagename },
}
local args = require("Module:parameters").process(frame:getParent().args, params)
local output_text, respellings, transcriptions, ipas = {}, {}, {}, {}
if find(pagename, "") then return_error() end
if #args[1] == 0 then args[1] = { args.word } end
for _, param in ipairs(args[1]) do
if find(param, "") then return_error() end
table.insert(respellings, export.syllabify(param))
table.insert(transcriptions, export.convert(param, "tc", "temp"))
table.insert(ipas, export.convert(param, "ipa"))
end
separate = (gsub(table.concat(respellings), "[%- ]", "")) ~= args.word
respelling = table.concat(respellings, " / ")
local function row(a, b, class, lang, size)
return "\n<tr>" ..
tostring( mw.html.create( "td" )
:css( "padding-right", "0.8em" )
:css( "padding-left", "0.7em" )
:css( "font-size", "10.5pt" )
:css( "font-family", "DejaVu Sans, sans-serif" )
:css( "color", "#555" )
:css( "font-weight", "bold" )
:css( "background-color", "#F8F9F8" )
:wikitext(a)) .. "\n" ..
tostring( mw.html.create( "td" )
:css( "padding-left", "0.8em" )
:css( "padding-right", "0.8em" )
:css( "padding-top", ".4em" )
:css( "padding-bottom", ".4em" )
:wikitext(b)) ..
"</tr>"
end
local function textFormat(text, class, size, lang)
return tostring( mw.html.create( "span" )
:attr( "class", class or "Khmr" )
:css( "font-size", size or (class == "IPA" and "95%" or "130%") )
:attr( "lang", lang or (class == "IPA" and nil or "km") )
:wikitext(text))
end
table.insert(output_text,
[=[{| style="margin: 0 .4em .4em .4em"
|
<table cellpadding=1 style="border: 1px solid #DFDFDF; text-align: center; line-height: 25pt; padding: .1em .3em .1em .3em">]=] ..
row(separate
and "[[w:高棉文|寫法]]"
or "[[w:高棉文|寫法/音素]]",
textFormat(args.word) .. "<br>" .. textFormat(gsub(gsub(args.word, ".", tl), "ʰ̥", "̥ʰ"), "IPA")
) ..
(separate
and row("''[[w:高棉文|音素]]''",
textFormat(respelling) .. "<br>" ..
textFormat(gsub(gsub(respelling, ".", tl), "ʰ̥", "̥ʰ"), "IPA"))
or "") ..
row("[[Wiktionary:高棉語羅馬化|維基詞典羅馬化]]",
textFormat(table.concat(transcriptions, ", "), "IPA", "100%")
) ..
row(
"([[w:高棉語|標準發音]]) [[Wiktionary:國際音標|IPA]]" ..
"<sup>([[Wiktionary:高棉語羅馬化|說明]])</sup>",
textFormat("/" .. table.concat(ipas, "/ ~ /") .. "/", "IPA", "110%")
) ..
(args.a
and row("Audio", mw.getCurrentFrame():expandTemplate{
title = "Template:audio",
args = { args.a == "y" and "Km-" .. args.word .. ".ogg" or args.a, lang = "km" }} )
or ""
) ..
"</table>\n|}" .. "[[Category:有國際音標的高棉語詞]]")
return table.concat(output_text)
end
return export