Jump to content

Module:kl-pron/testcases

From Wiktionary, the free dictionary

All tests passed. (refresh)

TextExpectedActual
test_phonetic:
Passedaarlorpoq[ɑʶːɬ.ɬɔp.pɔq][ɑʶːɬ.ɬɔp.pɔq]
Passedaaffaq[aːf.fɑq][aːf.fɑq]
Passedataaseq[a.təː.sɜq][a.təː.sɜq]
Passedatsa[at.t͡sa][at.t͡sa]
Passederrorpaa[ɜχ.χɔp.pəː][ɜχ.χɔp.pəː]
Passed-ersi[-ɜs.sɪ][-ɜs.sɪ]
Passedillu[iɬ.ɬʊ][iɬ.ɬʊ]
Passedimeq[y.mɜq][y.mɜq]
PassedInutsiaq[i.nʉt.t͡sɪ.ɑq][i.nʉt.t͡sɪ.ɑq]
Passedinuuvoq[i.nʊː.ʷɔq][i.nʊː.ʷɔq]
Passedivigaq[i.vɪ.ɣɑq][i.vɪ.ɣɑq]
PassedKiistiina[kɪːs.t͡sɪː.na][kɪːs.t͡sɪː.na]
Passedmitiusat[mɪ.t͡sɪ.ʊ.sət][mɪ.t͡sɪ.ʊ.sət]
Passednagga[nəx̟.x̟a][nəx̟.x̟a]
Passed-nnger[-ŋ.ŋɜʁ][-ŋ.ŋɜʁ]
Passed-nnak[-n.nək][-n.nək]
Passednuarluk[nʊ.ʷɑɬ.ɬʊk][nʊ.ʷɑɬ.ɬʊk]
Passedpeqqippoq[pɜq.qyp.pɔq][pɜq.qyp.pɔq]
Passedqaqortoq[qɑ.qɔt.tɔq][qɑ.qɔt.tɔq]
Passedqasilitsut[qə.sɪ.lɪt.t͡sʉt][qə.sɪ.lɪt.t͡sʉt]
Passedqimmeq[qym.mɜq][qym.mɜq]
Passedqimmiq[qym.mɐq][qym.mɐq]
Passedsigguk[sɪç.çʊk][sɪç.çʊk]
Passedsuliffik[sʉ.lɪf.fɪk][sʉ.lɪf.fɪk]
Passedtinuvoq[t͡sɪ.nʊ.ʷɔq][t͡sɪ.nʊ.ʷɔq]
Passedui[u.ʷɪ][u.ʷɪ]

local tests = require("Module:UnitTests")
local ipa = require("Module:kl-pron")
local link = require("Module:links")

local lang = require("Module:languages").getByCode("kl")
local sc = require("Module:scripts").getByCode("Latn")

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

function tests:check_output(term, expected)
	self:equals(
		link.full_link({ term = term, lang = lang, sc = sc } ),
		tag_IPA(ipa.phonetic(term)),
		tag_IPA(expected)
	)
end

function tests:test_phonetic()
	examples = {
		{ "aarlorpoq", "ɑʶːɬ.ɬɔp.pɔq" },
		{ "aaffaq", "aːf.fɑq" },
		{ "ataaseq", "a.təː.sɜq" },
		{ "atsa", "at.t͡sa" },
		{ "errorpaa", "ɜχ.χɔp.pəː" },
		{ "-ersi", "-ɜs.sɪ" },
		{ "illu", "iɬ.ɬʊ" },
		{ "imeq", "y.mɜq" },
		{ "Inutsiaq", "i.nʉt.t͡sɪ.ɑq" },
		{ "inuuvoq", "i.nʊː.ʷɔq" },
		{ "ivigaq", "i.vɪ.ɣɑq" },
		{ "Kiistiina", "kɪːs.t͡sɪː.na" },
		{ "mitiusat", "mɪ.t͡sɪ.ʊ.sət" },
		{ "nagga", "nəx̟.x̟a" },
		{ "-nnger", "-ŋ.ŋɜʁ" },
		{ "-nnak", "-n.nək" },
		{ "nuarluk", "nʊ.ʷɑɬ.ɬʊk" },
		{ "peqqippoq", "pɜq.qyp.pɔq" },
		{ "qaqortoq", "qɑ.qɔt.tɔq" },
		{ "qasilitsut", "qə.sɪ.lɪt.t͡sʉt" },
		{ "qimmeq", "qym.mɜq" },
		{ "qimmiq", "qym.mɐq" },
		{ "sigguk", "sɪç.çʊk" },
		{ "suliffik", "sʉ.lɪf.fɪk" },
		{ "tinuvoq", "t͡sɪ.nʊ.ʷɔq" },
		{ "ui", "u.ʷɪ" }
	}

	self:iterate(examples, "check_output")
end

return tests