Module:my-pron/testcases

local tests = require('Module:UnitTests') local m_my_pron = require('Module:my-pron') local m_links = require('Module:links')

local lang = require('Module:languages').getByCode('my')

local function tag_IPA(IPA) return mw.ustring.gsub(IPA, "^%S+", ' %0 ') end

function tests:check_pron(word, respelling, expected) self:equals(		m_links.full_link({lang = lang, term = word, tr = '-'}, nil, true) ..			(respelling ~= word and (" (respelled " .. respelling .. " )") or ""),		m_my_pron.generate_tests(word, respelling),		expected,		{ nowiki = true, display = tag_IPA }	) end

local examples = { { "ကစား", "+က'+စား", "ɡəzá | ka.ca: | kacāʺ | găza: | (k)ă(s)à" }, { "ကတ်ဝက်", "ကတ်ဝက်", "kaʔwɛʔ | kat-wak | katʻvakʻ | kat-wet | kaʔweʔ" }, { "ကပျာကယာ", "+ka'+pya+ka'ya", "ɡəbjàɡəjà | ka.pyaka.ya | kapyākayā | găbyagăya | (k)ă(p)ya(k)ăya" }, { "ကပျာကယာ", "+က'+ပျာ+က'ယာ", "ɡəbjàɡəjà | ka.pyaka.ya | kapyākayā | găbyagăya | (k)ă(p)ya(k)ăya" }, { "ကြိုဆိုပါ၏", "ကြို+ဆို+ပါ၏", "t͡ɕòzòbàʔɛ̰ | kruihcuipae | kruichuipāe* | kyozobaè. | cou(hs)ou(p)aé" }, { "ကွန်ပျူတာ", "ကွန်ပျူတာ", "kʊ̀ɴpjùtà | kwanpyuta | kvanʻpyūtā | kunpyuta | kuñpyuta" }, { "ကာတွက်", "ကာတွက်", "kàtwɛʔ | ka-twak | kātvakʻ | ka-twet | katweʔ" }, { "ခြေထောက်", "ခြေ+ထောက်", "t͡ɕʰèdaʊʔ | hkrehtauk | khrethokʻ | chedauk | hcei(ht)auʔ" }, { "ခလုတ်", "ခ'လုတ်", "kʰəloʊʔ | hka.lut | khalutʻ | hkălok | hkălouʔ" }, { "ငါးဥ", "ငါး'ဥ", "ŋəʔṵ | nga:u. | ṅāʺu | ngău. | ngăú" }, { "စာကြည့်တိုက်", "စာကြည့်+တိုက်", "sàt͡ɕḭdaɪʔ | ca-krany.tuik | cākraññʻʹtuikʻ | sa-kyi.daik | sací(t)aiʔ" }, { "စာရေး", "စာ'ရေး", "səjé | care: | cāreʺ | săye: | săyeì" }, { "ဆန်ပြုတ်", "ဆန်+ပြုတ်", "sʰàɴbjoʊʔ | hcanprut | chanʻprutʻ | hsanbyok | hsañ(p)youʔ" }, { "ဆီပုံး", "ဆီ+ပုံး", "sʰìbóʊɴ | hcipum: | chīpuṃʺ | hsibon: | hsi(p)oùñ" }, { "တန်ဂါ", "တန်ဂါ", "tàɴɡà | tan-ga | tanʻgā | tan-ga | tañga" }, { "တာငါ", "တာငါ", "tàŋà | ta-nga | tāṅā | ta-nga | tanga" }, { "ဒူးထောက်", "ဒူးထောက်", "dútʰaʊʔ | du:htauk | dūʺthokʻ | du:htauk | dùhtauʔ" }, { "နက်ဖြန်", "ne?hpya~", "nɛʔpʰjàɴ | nakhpran | nakʻphranʻ | nethpyan | neʔhpyañ" }, { "နက်ဖြန်", "နက်ဖြန်", "nɛʔpʰjàɴ | nakhpran | nakʻphranʻ | nethpyan | neʔhpyañ" }, { "ပရိဘောဂ", "pa'ri/bo\\ga/", "pəɹḭbɔ́ɡa̰ | pa.ri.bhau:ga. | paribhoga | pări.baw:ga. | păríbògá" }, { "ပရိဘောဂ", "ပ'*ရိဘောဂ", "pəɹḭbɔ́ɡa̰ | pa.ri.bhau:ga. | paribhoga | pări.baw:ga. | păríbògá" }, { "ဖြည်းဖြည်း", "ဖြည်2း+ဖြည်2း", "pʰjébjé | hprany:hprany: | phraññʻʺphraññʻʺ | hpye:bye: | hpyeì(hp)yeì" }, { "ဘခင်", "-ဘ+ခင်", "pʰa̰ɡɪ̀ɴ | bha.hkang | bhakhaṅʻ | hpa.gin | hpá(hk)iñ" }, { "မင်္ဂလာပါ", "mi~ga'la+pa", "mɪ̀ɴɡəlàbà | mangga.lapa | maṅʻgalāpā | min-gălaba | miñgăla(p)a" }, { "မင်္ဂလာပါ", "မင်္ဂ'လာ+ပါ", "mɪ̀ɴɡəlàbà | mangga.lapa | maṅʻgalāpā | min-gălaba | miñgăla(p)a" }, { "မျက်စိ", "မျက်စိ", "mjɛʔsḭ | myakci. | myakʻci | myetsi. | myeʔsí" }, { "မြန်မာ", "မြန်မာ", "mjàɴmà | mranma | mranʻmā | myanma | myañma" }, { "လျှင်", "*လျှင်", "l̥jɪ̀ɴ | hlyang | lyhaṅʻ | hlyin | hlyiñ" }, { "လျှို့ဝှက်", "လျှို့ဝှက်", "ʃo̰ʍɛʔ | hlyui.hwak | lyhuiʹvhakʻ | sho.hwet | hyoúhweʔ" }, { "ဝက်ဝံ", "ဝက်ဝံ", "wɛʔwʊ̀ɴ | wak-wam | vakʻvaṃ | wet-wun | weʔwuñ" }, { "သူငယ်", "သူ'ငယ်", "θəŋɛ̀ | su-ngai | sūṅayʻ | thăngè | thănge" }, { "အက်ယန်", "အက်ယန်", "ʔɛʔjàɴ | ak-yan | ʼakʻyanʻ | etyan | eʔyañ" }, { "အခွံ", "အ'ခွံ", "ʔəkʰʊ̀ɴ | a.hkwam | ʼakhvaṃ | ăhkun | ăhkuñ" }, { "အညာသား", "အ'ညာ+သား", "ʔəɲàðá | a.nyasa: | ʼaññāsāʺ | ănyadha: | ănya(th)à" }, { "အမြီး", "အ'မီး", "ʔəmí | a.mri: | ʼamrīʺ | ămi: | ămì" }, { "အာကျန်", "အာကျန်", "ʔàt͡ɕàɴ | a-kyan | ʼākyanʻ | a-kyan | acañ" }, { "အုန်းဆီ", "အုန်း+ဆီ", "ʔóʊɴzì | un:hci | ʼunʻʺchī | on:zi | oùñ(hs)i" }, { "ကမ်းခြေ", "ကမ်း+ခြေ", "káɴd͡ʑè | kam:hkre | kamʻʺkhre | kan:gye | kàñ(hc)ei" }, { "ကမ္ဘာ", "+ကမ်'ဘာ", "ɡəbà | kambha | kambhā | găba | (k)ăba" }, { "မန္တလေး", "မန်+တ'လေး", "màɴdəlé | manta.le: | mantaleʺ | mandăle: | mañ(t)ăleì" }, { "ဆောင်းဦး", "ဆောင်းဦး", "sʰáʊɴʔú | hcaung:u: | choṅʻʺūʺ | hsaung:u: | hsaùñù" }, { "ဆော့", "ဆော့", "sʰɔ̰ | hcau. | choʹ | hsaw. | hsó" }, { "အဘိဓာန်", "a'bi/da~", "ʔəbḭdàɴ | a.bhi.dhan | ʼabhidhānʻ | ăbi.dan | ăbídañ" }, { "အဘိဓာန်", "a'bei?da~", "ʔəbeɪʔdàɴ | a.bhi.dhan | ʼabhidhānʻ | ăbeikdan | ăbeiʔdañ" }, { "တက္ကသိုလ်", "te?ka'thou", "tɛʔkəθò | takka.suil | takkasuilʻ | tetkătho | teʔkăthou" }, { "ကဲ့", "ကဲ့", "kɛ̰ | kai. | kaiʹ | kè. | ké" }, { "ဒေါ်", "ဒေါ်", "dɔ̀ | dau | doʻ | daw | do" }, { "ပေါက်တူး", "ပေါက်တူး", "paʊʔtú | pauktu: | pokʻtūʺ | pauktu: | pauʔtù" }, { "ဩစတြေးလျ", "ဩစ'တ'*ရေး*လျ", "ʔɔ́sətəɹélja̰ | au:ca.tre:lya. | ocatreʺlya | aw:sătăre:lya. | òsătăreìlyá" }, { "ဩစတြေးလျ", "o\\sa'ta'rei\\lya/", "ʔɔ́sətəɹélja̰ | au:ca.tre:lya. | ocatreʺlya | aw:sătăre:lya. | òsătăreìlyá" }, { "အိန္ဒိယ", "အိန္ဒိယ", "ʔèɪɴdḭja̰ | indi.ya. | ʼindiya | eindi.ya. | eiñdíyá" }, { "သွင်သွင်", "သွင်+သွင်", "θwɪ̀ɴðwɪ̀ɴ | swangswang | svaṅʻsvaṅʻ | thwindhwin | thwiñ(th)wiñ" }, { "ရွှံ့", "ရွှံ့", "ʃʊ̰ɴ | hrwam. | rvhaṃʹ | shun. | hyúñ" }, { "သာမဏေ", "သာမ'ဏေ", "θàmənè | sama.ne | sāmaṇe | thamăne | thamănei" }, { "ဝမ်း", "w/a\\~", "wáɴ | wam: | vamʻʺ | wan: | wàñ" }, { "ဝမ်း", "ဝ/န်း", "wáɴ | wam: | vamʻʺ | wan: | wàñ" }, { "တျူလစ်", "တျူလစ်", "tjùlɪʔ | tyulac | tyūlacʻ | tyulit | tyuliʔ" }, { "သောမနဿ", "သောမ'နဿ", "θɔ́mənaʔθa̰ | sau:ma.na.ssa. | somanassa | thaw:mănattha. | thòmănaʔthá" }, }

function tests:test_pron self:iterate(		examples,		function (self, ...)			self:check_pron(...)		end) end

return tests