Module:id-pronunciation/testcases

From Wiktionary, the free dictionary
Jump to navigation Jump to search

4 of 36 tests failed. (refresh)

TextExpectedActual
test_phonetic_pron:
Passedair (respelled air)ˈa.ɪrˈa.ɪr
PassedAlqur'an (respelled Alkur.ān)al.kurˈanal.kurˈan
Passedanjang (respelled anjang)ˈan.d͡ʒaŋˈan.d͡ʒaŋ
PassedCileunyi (respelled Cilenyī)t͡ʃi.ləˈɲit͡ʃi.ləˈɲi
Passedcuci (respelled cuci)ˈt͡ʃu.t͡ʃiˈt͡ʃu.t͡ʃi
Passeddaerah (respelled daèrah)daˈɛ.rahdaˈɛ.rah
Passeddakwa (respelled daqwa)ˈdaʔ.waˈdaʔ.wa
Passeddatang (respelled datang)ˈda.t̪aŋˈda.t̪aŋ
PassedFebruari (respelled Fè.bruari)fɛ.bruˈa.rifɛ.bruˈa.ri
Passedgajah (respelled gajah)ˈɡa.d͡ʒahˈɡa.d͡ʒah
Passedgelak (respelled gelaq)ɡəˈlaʔɡəˈlaʔ
Passedgereja (respelled gerèja)ɡəˈrɛ.d͡ʒaɡəˈrɛ.d͡ʒa
Failedgong (respelled gong)ɡɔnɡˈɡoŋ
Passedgunung (respelled gunung)ˈɡu.nʊŋˈɡu.nʊŋ
Passedhijau (respelled hijau)ˈhi.d͡ʒau̯ˈhi.d͡ʒau̯
Passedkhidmat (respelled khidmat)ˈxit̪̚.mat̪̚ˈxit̪̚.mat̪̚
Failedinstan (respelled instan)in.stanˈins.t̪an
Passedlaut (respelled laut)ˈla.ʊt̪̚ˈla.ʊt̪̚
PassedLhokseumawe (respelled Lòksemawè)lɔk̚.səˈma.wɛlɔk̚.səˈma.wɛ
Passednasionalisme (respelled nasionalisme)na.si.o.naˈlis.məna.si.o.naˈlis.mə
Passednikmat (respelled niqmat)ˈniʔ.mat̪̚ˈniʔ.mat̪̚
Failed-nya (respelled -nya)ɲaˈɲa
Passedpakaian (respelled pakaian)paˈka.janpaˈka.jan
Passedpantai (respelled pantai)ˈpan.t̪ai̯ˈpan.t̪ai̯
Passedpraktik (respelled praktik)ˈprak̚.t̪ɪk̚ˈprak̚.t̪ɪk̚
Passedpria (respelled pria)ˈpri.aˈpri.a
Passedprovinsi (respelled provinsi)proˈfin.siproˈfin.si
Passedpulau (respelled pulau)ˈpu.lau̯ˈpu.lau̯
Passedrakyat (respelled raqyat)ˈraʔ.jat̪̚ˈraʔ.jat̪̚
Passedselamat (respelled selamat)səˈla.mat̪̚səˈla.mat̪̚
Failedseumpama (respelled seumpama)se.umpamasəmˈpa.ma
Passedsiomay (respelled siomay)siˈo.mai̯siˈo.mai̯
Passedsyarat (respelled syarat)ˈʃa.rat̪̚ˈʃa.rat̪̚
Passedtelur (respelled telur)t̪əˈlʊrt̪əˈlʊr
Passedtidak (respelled tidaq)ˈt̪i.daʔˈt̪i.daʔ
PassedTionghoa (respelled Tionghoa)t̪i.oŋˈho.at̪i.oŋˈho.a

local tests = require("Module:UnitTests")
local m_id_pron = require("Module:id-pronunciation")

local function id_IPA(IPA)
	return "<span class='IPA'>" .. IPA .. "</span>"
end

local function id_spelling(spelling)
	return "<code>" .. spelling .. "</code>"
end

local function display_text_and_respelling(text, respelling)
	return ("[[%s#Indonesian|%s]] (respelled %s)"):format(text, text, id_spelling(respelling))
end

function tests:check_phonetic_ipa(text, expected, respelling)
	self:equals(
		display_text_and_respelling(text, respelling),
		m_id_pron.IPA(respelling)["phonetic"],
		expected,
		{ display = id_IPA }
	)
end

function tests:test_phonetic_pron()
	local examples = {
        { "air", "ˈa.ɪr", "air" },
		{ "Alqur'an", "al.kurˈan", "Alkur.ān"},
        { "anjang", "ˈan.d͡ʒaŋ", "anjang" },
        { "Cileunyi", "t͡ʃi.ləˈɲi", "Cilenyī" },
        { "cuci","ˈt͡ʃu.t͡ʃi", "cuci"},
		{ "daerah","daˈɛ.rah", "daèrah" },
		{ "dakwa", "ˈdaʔ.wa", "daqwa"},
		{ "datang","ˈda.t̪aŋ", "datang" },
        { "Februari","fɛ.bruˈa.ri", "Fè.bruari" },
        { "gajah", "ˈɡa.d͡ʒah", "gajah" },
		{ "gelak", "ɡəˈlaʔ", "gelaq"},
		{ "gereja","ɡəˈrɛ.d͡ʒa", "gerèja" },
		{ "gong","ɡɔnɡ", "gong" },
		{ "gunung","ˈɡu.nʊŋ", "gunung" },
        { "hijau","ˈhi.d͡ʒau̯", "hijau" },
		{ "khidmat", "ˈxit̪̚.mat̪̚", "khidmat"},
      	{ "instan", "in.stan", "instan"},
        { "laut", "ˈla.ʊt̪̚", "laut" },
        { "Lhokseumawe", "lɔk̚.səˈma.wɛ", "Lòksemawè" },
        { "nasionalisme", "na.si.o.naˈlis.mə", "nasionalisme" },
        { "nikmat", "ˈniʔ.mat̪̚", "niqmat" },
        { "-nya","ɲa", "-nya" },
        { "pakaian","paˈka.jan", "pakaian" },
        { "pantai", "ˈpan.t̪ai̯", "pantai" },
        { "praktik", "ˈprak̚.t̪ɪk̚",	"praktik" },
		{ "pria", "ˈpri.a", "pria"},
		{ "provinsi", "proˈfin.si", "provinsi"},
        { "pulau", "ˈpu.lau̯", "pulau" },
		{ "rakyat", "ˈraʔ.jat̪̚", "raqyat"},
		{ "selamat", "səˈla.mat̪̚", "selamat"},
		{ "seumpama", "se.umpama", "seumpama"},
	
		{ "siomay", "siˈo.mai̯", "siomay"},
		{ "syarat", "ˈʃa.rat̪̚", "syarat"},
		{ "telur", "t̪əˈlʊr", "telur"},
		{ "tidak", "ˈt̪i.daʔ", "tidaq"},
		{ "Tionghoa", "t̪i.oŋˈho.a", "Tionghoa"},
	}
	self:iterate(examples, "check_phonetic_ipa")
end

return tests