高棉語發音模塊。參見{{km-IPA}}

測試用例

Module:km-pron/testcases

Module:km-pron/testcases/data stores the testcase data.

全部測試及格。 (刷新)

文字 預期 實際 Differs at
test_ipa:
Passed ក្បាល kɓaːl kɓaːl
Passed ស្អែក sʔaek sʔaek
Passed ផ្សេង pʰseːŋ pʰseːŋ
Passed ល្មម lmɔːm lmɔːm
Passed ភ្ជុំ pʰcum pʰcum
Passed ម្នាស់ mnŏəh mnŏəh
Passed ផ្ទះ pʰtĕəh pʰtĕəh
Passed ខ្ញុំ kɲom kɲom
Passed ប្ដី pɗəj pɗəj
Passed ឆ្វេង cʰʋeːŋ cʰʋeːŋ
Passed ហ្វឹក fək fək
Passed ឡាន laːn laːn
Passed ឃាត់ kʰŏət kʰŏət
Passed ខាត់ kʰat kʰat
Passed ញាំ ɲŏəm ɲŏəm
Passed ល្ហុង lhoŋ lhoŋ
Passed សព្វ (respelling: សប់) sɑp sɑp
Passed អ្នក (respelling: នាក់) nĕəʔ nĕəʔ
Passed លក់ lŭəʔ lŭəʔ
Passed សង្កាត់ sɑŋ.ˈkat sɑŋ.ˈkat
Passed ទម្ងន់ tum.ˈŋŭən tum.ˈŋŭən
Passed ម្ញ៉ិកម្ញ៉ក់ mɲək.ˈmɲɑʔ mɲək.ˈmɲɑʔ
Passed ប្រយ័ត (respelling: ប្រយ៉ាត់) prɑ.ˈjat prɑ.ˈjat
Passed បារី (respelling: បារ៉ី) ɓaː.ˈrəj ɓaː.ˈrəj
Passed កន្លែង (respelling: កន្ល៉ែង) kɑn.ˈlaeŋ kɑn.ˈlaeŋ
Passed ស្រលាញ់ (respelling: ស្រ-ល៉ាញ់, ស្រ'-ល៉ាញ់) srɑ.ˈlaɲ, srə.ˈlaɲ srɑ.ˈlaɲ, srə.ˈlaɲ
Passed គំនិត kum.ˈnɨt kum.ˈnɨt
Passed ត្រជាក់ trɑ.ˈcĕəʔ trɑ.ˈcĕəʔ
Passed ជណ្ដើរ cŭən.ˈɗaə cŭən.ˈɗaə
Passed ទំហំ (respelling: ទំហ៊ំ) tum.ˈhum tum.ˈhum
Passed វិហារ (respelling: វិហ៊ា) ʋi.ˈhiə ʋi.ˈhiə
Passed បវត្តិ (respelling: ប៉ៈវ័ត) paʔ.ˈʋŏət paʔ.ˈʋŏət
Passed ចេតនា (respelling: ចេតៈន៉ា) ceː.taʔ.naː ceː.taʔ.naː
Passed វេទនា (respelling: វេទៈនា) ʋei.tĕəʔ.niə ʋei.tĕəʔ.niə
Passed សំស្ក្រឹត (respelling: ស័ង-ស្ក្រិត, ស័ង-សៈក្រិត) saŋ.ˈskrət, saŋ.saʔ.krət saŋ.ˈskrət, saŋ.saʔ.krət
Passed បន្តក់ ɓɑn.ˈtɑʔ ɓɑn.ˈtɑʔ
Passed សាស្ត្រា (respelling: សាស-ស្ត្រា) saːh.ˈstraː saːh.ˈstraː
Passed បដិសេធ (respelling: ប៉ៈដិសែត) paʔ.ɗe.saet paʔ.ɗe.saet
Passed បរិយោសាន (respelling: ប៉ៈរ៉ិយ៉ោសាន) paʔ.re.jao.saːn paʔ.re.jao.saːn
Passed ភ្នែកមាន់ (respelling: ភ្នែក មាន់) pʰnɛːk ˈmŏən pʰnɛːk ˈmŏən
Passed ផ្សេងៗ (respelling: ផ្សេងផ្សេង) pʰseːŋ.ˈpʰseːŋ pʰseːŋ.ˈpʰseːŋ
Passed កញ្ញា (respelling: ក័ញ្ញ៉ា) kaɲ.ˈɲaː kaɲ.ˈɲaː
Passed ភ្នំពេញ (respelling: ភ្នំ ពេញ) pʰnum ˈpɨɲ pʰnum ˈpɨɲ
Passed រុក្ខវិថី (respelling: រុកខៈ វិថី) ruk.kʰaʔ ʋi.tʰəj ruk.kʰaʔ ʋi.tʰəj
Passed សហរដ្ឋអាមេរិក (respelling: សៈហៈ រ័ត អាមេរិក) saʔ.haʔ rŏət ʔaː.mei.rɨk saʔ.haʔ rŏət ʔaː.mei.rɨk
Passed លលក (respelling: ល-លក) lɔ.ˈlɔːʔ lɔ.ˈlɔːʔ
Passed របស់ (respelling: រ-បស់, រ'-បស់) rɔ.ˈɓɑh, rə.ˈɓɑh rɔ.ˈɓɑh, rə.ˈɓɑh
Passed បរិភោគ (respelling: បរ៉ិភោក) ɓɑː.re.pʰoːk ɓɑː.re.pʰoːk
Passed ធំ (respelling: ថុំ) tʰom tʰom
Passed វចនានុក្រម (respelling: វៈ-ចៈ-ន៉ា-នុ-ក្រំ) ʋĕəʔ.caʔ.naː.nu.krɑm ʋĕəʔ.caʔ.naː.nu.krɑm
Passed សាសន (respelling: សាសៈន៉ៈ) saː.saʔ.naʔ saː.saʔ.naʔ
Passed សាសនា (respelling: សា-ស្នា) saː.ˈsnaː saː.ˈsnaː
Passed កិរិយា (respelling: កិរិយ៉ា) ke.ri.jaː ke.ri.jaː
Passed ល្អូកល្អិន lʔouk.ˈlʔən lʔouk.ˈlʔən
Passed ឆ្ងាញ់ cʰŋaɲ cʰŋaɲ
Passed ប្រធានាធិបតី (respelling: ប្រ់ធានាធិបប៉ៈដី) prɑ.tʰiə.niə.tʰɨp.paʔ.ɗəj prɑ.tʰiə.niə.tʰɨp.paʔ.ɗəj
Passed ឧសភា (respelling: អុសៈភា, អ៊ុសៈភា) ʔo.saʔ.pʰiə, ʔu.saʔ.pʰiə ʔo.saʔ.pʰiə, ʔu.saʔ.pʰiə
Passed ហ្វៃហ្វា (respelling: វ៉ៃ-វ៉ា, ហ្វៃ-ហ្វា) ʋaj.ˈʋaː, faj.ˈfaː ʋaj.ˈʋaː, faj.ˈfaː
Passed កម្មវិធី (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ː
Passed រថ (respelling: រត់) rŭət rŭət
Passed កម្ពុជា (respelling: ក័មពុជា) kam.pu.ciə kam.pu.ciə
Passed រុស្ស៊ី (respelling: រុស៊ី) ru.ˈsiː ru.ˈsiː
Passed ចក្រ (respelling: ច័ក, ច័ក-ក្រៈ-) caʔ, caʔ.kraʔ. caʔ, caʔ.kraʔ.
Passed អម្ពិល (respelling: អំពិល) ʔɑm.ˈpɨl ʔɑm.ˈpɨl
文字 預期 實際 Differs at
test_syllabify:
Passed ក្បាល ក្បាល ក្បាល
Passed ស្អែក ស្អែក ស្អែក
Passed ផ្សេង ផ្សេង ផ្សេង
Passed ល្មម ល្មម ល្មម
Passed ភ្ជុំ ភ្ជុំ ភ្ជុំ
Passed ម្នាស់ ម្នាស់ ម្នាស់
Passed ផ្ទះ ផ្ទះ ផ្ទះ
Passed ខ្ញុំ ខ្ញុំ ខ្ញុំ
Passed ប្ដី ប្ដី ប្ដី
Passed ឆ្វេង ឆ្វេង ឆ្វេង
Passed ហ្វឹក ហ្វឹក ហ្វឹក
Passed ឡាន ឡាន ឡាន
Passed ឃាត់ ឃាត់ ឃាត់
Passed ខាត់ ខាត់ ខាត់
Passed ញាំ ញាំ ញាំ
Passed ល្ហុង ល្ហុង ល្ហុង
Passed សព្វ (respelling: សប់) សប់ សប់
Passed អ្នក (respelling: នាក់) នាក់ នាក់
Passed លក់ លក់ លក់
Passed សង្កាត់ ស-ង្កាត់ ស-ង្កាត់
Passed ទម្ងន់ ទ-ម្ងន់ ទ-ម្ងន់
Passed ម្ញ៉ិកម្ញ៉ក់ ម្ញ៉ិក-ម្ញ៉ក់ ម្ញ៉ិក-ម្ញ៉ក់
Passed ប្រយ័ត (respelling: ប្រយ៉ាត់) ប្រ-យ៉ាត់ ប្រ-យ៉ាត់
Passed បារី (respelling: បារ៉ី) បា-រ៉ី បា-រ៉ី
Passed កន្លែង (respelling: កន្ល៉ែង) ក-ន្ល៉ែង ក-ន្ល៉ែង
Passed ស្រលាញ់ (respelling: ស្រ-ល៉ាញ់, ស្រ'-ល៉ាញ់) ស្រ-ល៉ាញ់, ស្រ'-ល៉ាញ់ ស្រ-ល៉ាញ់, ស្រ'-ល៉ាញ់
Passed គំនិត គំ-និត គំ-និត
Passed ត្រជាក់ ត្រ-ជាក់ ត្រ-ជាក់
Passed ជណ្ដើរ ជ-ណ្ដើរ ជ-ណ្ដើរ
Passed ទំហំ (respelling: ទំហ៊ំ) ទំ-ហ៊ំ ទំ-ហ៊ំ
Passed វិហារ (respelling: វិហ៊ា) វិ-ហ៊ា វិ-ហ៊ា
Passed បវត្តិ (respelling: ប៉ៈវ័ត) ប៉ៈ-វ័ត ប៉ៈ-វ័ត
Passed ចេតនា (respelling: ចេតៈន៉ា) ចេ-តៈ-ន៉ា ចេ-តៈ-ន៉ា
Passed វេទនា (respelling: វេទៈនា) វេ-ទៈ-នា វេ-ទៈ-នា
Passed សំស្ក្រឹត (respelling: ស័ង-ស្ក្រិត, ស័ង-សៈក្រិត) ស័ង-ស្ក្រិត, ស័ង-សៈ-ក្រិត ស័ង-ស្ក្រិត, ស័ង-សៈ-ក្រិត
Passed បន្តក់ ប-ន្តក់ ប-ន្តក់
Passed សាស្ត្រា (respelling: សាស-ស្ត្រា) សាស-ស្ត្រា សាស-ស្ត្រា
Passed បដិសេធ (respelling: ប៉ៈដិសែត) ប៉ៈ-ដិ-សែត ប៉ៈ-ដិ-សែត
Passed បរិយោសាន (respelling: ប៉ៈរ៉ិយ៉ោសាន) ប៉ៈ-រ៉ិ-យ៉ោ-សាន ប៉ៈ-រ៉ិ-យ៉ោ-សាន
Passed ភ្នែកមាន់ (respelling: ភ្នែក មាន់) ភ្នែក មាន់ ភ្នែក មាន់
Passed ផ្សេងៗ (respelling: ផ្សេងផ្សេង) ផ្សេង-ផ្សេង ផ្សេង-ផ្សេង
Passed កញ្ញា (respelling: ក័ញ្ញ៉ា) ក័-ញ្ញ៉ា ក័-ញ្ញ៉ា
Passed ភ្នំពេញ (respelling: ភ្នំ ពេញ) ភ្នំ ពេញ ភ្នំ ពេញ
Passed រុក្ខវិថី (respelling: រុកខៈ វិថី) រុក-ខៈ វិ-ថី រុក-ខៈ វិ-ថី
Passed សហរដ្ឋអាមេរិក (respelling: សៈហៈ រ័ត អាមេរិក) សៈ-ហៈ រ័ត អា-មេ-រិក សៈ-ហៈ រ័ត អា-មេ-រិក
Passed លលក (respelling: ល-លក) ល-លក ល-លក
Passed របស់ (respelling: រ-បស់, រ'-បស់) រ-បស់, រ'-បស់ រ-បស់, រ'-បស់
Passed បរិភោគ (respelling: បរ៉ិភោក) ប-រ៉ិ-ភោក ប-រ៉ិ-ភោក
Passed ធំ (respelling: ថុំ) ថុំ ថុំ
Passed វចនានុក្រម (respelling: វៈ-ចៈ-ន៉ា-នុ-ក្រំ) វៈ-ចៈ-ន៉ា-នុ-ក្រំ វៈ-ចៈ-ន៉ា-នុ-ក្រំ
Passed សាសន (respelling: សាសៈន៉ៈ) សា-សៈ-ន៉ៈ សា-សៈ-ន៉ៈ
Passed សាសនា (respelling: សា-ស្នា) សា-ស្នា សា-ស្នា
Passed កិរិយា (respelling: កិរិយ៉ា) កិ-រិ-យ៉ា កិ-រិ-យ៉ា
Passed ល្អូកល្អិន ល្អូក-ល្អិន ល្អូក-ល្អិន
Passed ឆ្ងាញ់ ឆ្ងាញ់ ឆ្ងាញ់
Passed ប្រធានាធិបតី (respelling: ប្រ់ធានាធិបប៉ៈដី) ប្រ់-ធា-នា-ធិប-ប៉ៈ-ដី ប្រ់-ធា-នា-ធិប-ប៉ៈ-ដី
Passed ឧសភា (respelling: អុសៈភា, អ៊ុសៈភា) អុ-សៈ-ភា, អ៊ុ-សៈ-ភា អុ-សៈ-ភា, អ៊ុ-សៈ-ភា
Passed ហ្វៃហ្វា (respelling: វ៉ៃ-វ៉ា, ហ្វៃ-ហ្វា) វ៉ៃ-វ៉ា, ហ្វៃ-ហ្វា វ៉ៃ-វ៉ា, ហ្វៃ-ហ្វា
Passed កម្មវិធី (respelling: ក័មវិធី, ក័ម្មៈវិធី, ក័ម្ម៉ៈវិធី) ក័ម-វិ-ធី, ក័-ម្មៈ-វិ-ធី, ក័-ម្ម៉ៈ-វិ-ធី ក័ម-វិ-ធី, ក័-ម្មៈ-វិ-ធី, ក័-ម្ម៉ៈ-វិ-ធី
Passed រថ (respelling: រត់) រត់ រត់
Passed កម្ពុជា (respelling: ក័មពុជា) ក័ម-ពុ-ជា ក័ម-ពុ-ជា
Passed រុស្ស៊ី (respelling: រុស៊ី) រុ-ស៊ី រុ-ស៊ី
Passed ចក្រ (respelling: ច័ក, ច័ក-ក្រៈ-) ច័ក, ច័ក-ក្រៈ- ច័ក, ច័ក-ក្រៈ-
Passed អម្ពិល (respelling: អំពិល) អំ-ពិល អំ-ពិល
文字 預期 實際 Differs at
test_transcript:
Passed ក្បាល kbaal kbaal
Passed ស្អែក sʾaek sʾaek
Passed ផ្សេង phseeng phseeng
Passed ល្មម lmɔɔm lmɔɔm
Passed ភ្ជុំ phcum phcum
Passed ម្នាស់ mnŏəh mnŏəh
Passed ផ្ទះ phtĕəh phtĕəh
Passed ខ្ញុំ khñom khñom
Passed ប្ដី pdəy pdəy
Passed ឆ្វេង chveeng chveeng
Passed ហ្វឹក fək fək
Passed ឡាន laan laan
Passed ឃាត់ khŏət khŏət
Passed ខាត់ khat khat
Passed ញាំ ñŏəm ñŏəm
Passed ល្ហុង lhong lhong
Passed សព្វ (respelling: សប់) sɑp sɑp
Passed អ្នក (respelling: នាក់) nĕək nĕək
Passed លក់ lŭək lŭək
Passed សង្កាត់ sɑngkat sɑngkat
Passed ទម្ងន់ tumngŭən tumngŭən
Passed ម្ញ៉ិកម្ញ៉ក់ mñəkmñɑk mñəkmñɑk
Passed ប្រយ័ត (respelling: ប្រយ៉ាត់) prɑyat prɑyat
Passed បារី (respelling: បារ៉ី) baarəy baarəy
Passed កន្លែង (respelling: កន្ល៉ែង) kɑnlaeng kɑnlaeng
Passed ស្រលាញ់ (respelling: ស្រ-ល៉ាញ់, ស្រ'-ល៉ាញ់) srɑlañ, srəlañ srɑlañ, srəlañ
Passed គំនិត kumnɨt kumnɨt
Passed ត្រជាក់ trɑcĕək trɑcĕək
Passed ជណ្ដើរ cŭəndaə cŭəndaə
Passed ទំហំ (respelling: ទំហ៊ំ) tumhum tumhum
Passed វិហារ (respelling: វិហ៊ា) vihiə vihiə
Passed បវត្តិ (respelling: ប៉ៈវ័ត) paʾvŏət paʾvŏət
Passed ចេតនា (respelling: ចេតៈន៉ា) ceetaʾnaa ceetaʾnaa
Passed វេទនា (respelling: វេទៈនា) veitĕəʾniə veitĕəʾniə
Passed សំស្ក្រឹត (respelling: ស័ង-ស្ក្រិត, ស័ង-សៈក្រិត) sangskrət, sangsaʾkrət sangskrət, sangsaʾkrət
Passed បន្តក់ bɑntɑk bɑntɑk
Passed សាស្ត្រា (respelling: សាស-ស្ត្រា) saahstraa saahstraa
Passed បដិសេធ (respelling: ប៉ៈដិសែត) paʾdesaet paʾdesaet
Passed បរិយោសាន (respelling: ប៉ៈរ៉ិយ៉ោសាន) paʾreyaosaan paʾreyaosaan
Passed ភ្នែកមាន់ (respelling: ភ្នែក មាន់) phnɛɛk mŏən phnɛɛk mŏən
Passed ផ្សេងៗ (respelling: ផ្សេងផ្សេង) phseengphseeng phseengphseeng
Passed កញ្ញា (respelling: ក័ញ្ញ៉ា) kaññaa kaññaa
Passed ភ្នំពេញ (respelling: ភ្នំ ពេញ) phnum pɨñ phnum pɨñ
Passed រុក្ខវិថី (respelling: រុកខៈ វិថី) rukkhaʾ vithəy rukkhaʾ vithəy
Passed សហរដ្ឋអាមេរិក (respelling: សៈហៈ រ័ត អាមេរិក) saʾhaʾ rŏət ʾaameirɨk saʾhaʾ rŏət ʾaameirɨk
Passed លលក (respelling: ល-លក) lɔlɔɔk lɔlɔɔk
Passed របស់ (respelling: រ-បស់, រ'-បស់) rɔbɑh, rəbɑh rɔbɑh, rəbɑh
Passed បរិភោគ (respelling: បរ៉ិភោក) bɑɑrephook bɑɑrephook
Passed ធំ (respelling: ថុំ) thom thom
Passed វចនានុក្រម (respelling: វៈ-ចៈ-ន៉ា-នុ-ក្រំ) vĕəʾcaʾnaanukrɑm vĕəʾcaʾnaanukrɑm
Passed សាសន (respelling: សាសៈន៉ៈ) saasaʾnaʾ saasaʾnaʾ
Passed សាសនា (respelling: សា-ស្នា) saasnaa saasnaa
Passed កិរិយា (respelling: កិរិយ៉ា) keriyaa keriyaa
Passed ល្អូកល្អិន lʾouklʾən lʾouklʾən
Passed ឆ្ងាញ់ chngañ chngañ
Passed ប្រធានាធិបតី (respelling: ប្រ់ធានាធិបប៉ៈដី) prɑthiəniəthɨppaʾdəy prɑthiəniəthɨppaʾdəy
Passed ឧសភា (respelling: អុសៈភា, អ៊ុសៈភា) ʾosaʾphiə, ʾusaʾphiə ʾosaʾphiə, ʾusaʾphiə
Passed ហ្វៃហ្វា (respelling: វ៉ៃ-វ៉ា, ហ្វៃ-ហ្វា) vayvaa, fayfaa vayvaa, fayfaa
Passed កម្មវិធី (respelling: ក័មវិធី, ក័ម្មៈវិធី, ក័ម្ម៉ៈវិធី) kamvithii, kammĕəʾvithii, kammaʾvithii kamvithii, kammĕəʾvithii, kammaʾvithii
Passed រថ (respelling: រត់) rŭət rŭət
Passed កម្ពុជា (respelling: ក័មពុជា) kampuciə kampuciə
Passed រុស្ស៊ី (respelling: រុស៊ី) rusii rusii
Passed ចក្រ (respelling: ច័ក, ច័ក-ក្រៈ-) cak, cakkraʾ cak, cakkraʾ
Passed អម្ពិល (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"] = "k​h", ["c%-h"] = "c​h", ["t%-h"] = "t​h", ["p%-h"] = "p​h",
	["n%-g"] = "n​g",
}

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