Jump to content

Module:mch-IPA/testcases

From Wiktionary, the free dictionary

All tests passed. (refresh)

TextExpectedActual
test_all:
Vowel length
Passedjüü[hʷɨː][hʷɨː]
Passedkushi[kuʃi][kuʃi]
Passednuunö[nuːnə][nuːnə]
Passedunwaa[uŋwaː][uŋwaː]
Passedadima[aɾ̠iːma][aɾ̠iːma]
Passedayawa[ajaːwa][ajaːwa]
Passedsadodo[saɾ̠oːɾ̠o][saɾ̠oːɾ̠o]
Passedadonka[aɾ̠oŋka][aɾ̠oŋka]
Passedaichudi[ajt͡ʃuɾ̠i][ajt͡ʃuɾ̠i]
Passedoonuku[oːnuku][oːnuku]
Passedkomomüdü[komoːmɨɾ̠ɨ][komoːmɨɾ̠ɨ]
Passedanadeke[anaːɾ̠eke][anaːɾ̠eke]
Passedtüdüemü[tɨɾ̠ɨːemɨ][tɨɾ̠ɨːemɨ]
Passedtojodüe[tohʷoːɾ̠ɨe][tohʷoːɾ̠ɨe]
Passedchööjüdü[t͡ʃəːhɨɾ̠ɨ][t͡ʃəːhɨɾ̠ɨ]
Passedchööjüdüjüdü[t͡ʃəːhɨɾ̠ɨːhɨɾ̠ɨ][t͡ʃəːhɨɾ̠ɨːhɨɾ̠ɨ]
Passedjuuwakadö[hʷuːwakaːɾ̠ə][hʷuːwakaːɾ̠ə]
Passeddadiweyudu[daɾ̠iːwejuːɾ̠u][daɾ̠iːwejuːɾ̠u]
Passedkadakadadi[kaɾ̠aːkaɾ̠aːɾ̠i][kaɾ̠aːkaɾ̠aːɾ̠i]
Passedaichudi edajö[ajt͡ʃuɾ̠i eɾ̠aːhə][ajt͡ʃuɾ̠i eɾ̠aːhə]
Passedtüwe'mojo'e[tɨweʔmohʷoʔe][tɨweʔmohʷoʔe]
PassedSedumeyanadi[seɾ̠uːmejaːnaɾ̠i][seɾ̠uːmejaːnaɾ̠i]
Passedwesuwadakadawö[wesuːwaɾ̠aːkaɾ̠aːwə][wesuːwaɾ̠aːkaɾ̠aːwə]
Forms of j
Passedoneja[oneːha][oneːha]
Passedjhumma[çumma][çumma]
Passedkoijai[kojçaj][kojçaj]
Passeddijushi[diçuːʃi][diçuːʃi]
Passedku'jö[kuʔhʷə][kuʔhʷə]
Passedji'jö[hʷiʔçə][hʷiʔçə]
Passedja'dötöme[hʷaʔdətəːme][hʷaʔdətəːme]
Passedta'jujuñe[taʔhʷuhʷuːɲe][taʔhʷuhʷuːɲe]
Passed-joi[-hoj][-hoj]
Passedekamjiyaka[ekamm̥ijaːka][ekamm̥ijaːka]
Passedjadii_jadi[hʷaɾ̠iːhʷaɾ̠i][hʷaɾ̠iːhʷaɾ̠i]
Forms of y and i
Passedoy-[oj-][oj-]
Passedka'ya[kaʔɟa][kaʔɟa]
Passedye'kwana[ɟeʔkʷana][ɟeʔkʷana]
Passedo'joiye[oʔhʷojje][oʔhʷojje]
Forms of w and u
Passedse'wadö[seʔwaɾ̠ə][seʔwaɾ̠ə]
Passedsawiya[saviːja][saviːja]
Passedshii awono ökato[ʃiː aβoːno əkaːto][ʃiː aβoːno əkaːto]
Passedaudaajö[awɾ̠ʷaːhə][awɾ̠ʷaːhə]
Passedta'kwañe[taʔkʷaɲe][taʔkʷaɲe]
Forms of n
Passednwawö[ŋwawə][ŋwawə]
Passednñanno[nɲanno][nɲanno]
Passedunke'ka[uŋkeʔka][uŋkeʔka]
Passednün'e[nɨŋŋe][nɨŋŋe]
Passedpan[paŋ][paŋ]
Forms of d
Passeddawade[dawaːɾ̠e][dawaːɾ̠e]
Passedsa'da'da[saʔdaʔda][saʔdaʔda]
Passedöddaajö[əddaːhə][əddaːhə]
Passedaudaajö edemi'jüdü[awɾ̠ʷaːhə eɾ̠eːmiʔçɨɾ̠ɨ][awɾ̠ʷaːhə eɾ̠eːmiʔçɨɾ̠ɨ]
Passedödhajö[əðaːhə][əðaːhə]
Passeddhanwa[ðaŋwa][ðaŋwa]
Passeda_d-[ad-][ad-]
Complex geminates
Passedössha[əʃʃa][əʃʃa]
Passedaccha[att͡ʃa][att͡ʃa]

local tests = require("Module:UnitTests")
local to_IPA = require("Module:mch-IPA").to_IPA

local lang = require("Module:languages").getByCode("mch")
local Latin = require("Module:scripts").getByCode("Latn")

local function link(term)
	return require("Module:links").full_link{ term = term, lang = lang, sc = Latin }
end

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

function tests:check_output(term, expected)
	tests:equals(
		link(term),
		to_IPA(term),
		expected,
		{ display = tag_IPA }
	)
end

function tests:test_all()
	local list = {
        "Vowel length",
		{ "jüü", "[hʷɨː]" },
		{ "kushi", "[kuʃi]" },
		{ "nuunö", "[nuːnə]" },
		{ "unwaa", "[uŋwaː]" },
		{ "adima", "[aɾ̠iːma]" },
		{ "ayawa", "[ajaːwa]" },
		{ "sadodo", "[saɾ̠oːɾ̠o]" },
		{ "adonka", "[aɾ̠oŋka]" },
		{ "aichudi", "[ajt͡ʃuɾ̠i]" },
		{ "oonuku", "[oːnuku]" },
		{ "komomüdü", "[komoːmɨɾ̠ɨ]" },
		{ "anadeke", "[anaːɾ̠eke]" },
		{ "tüdüemü", "[tɨɾ̠ɨːemɨ]" },
		{ "tojodüe", "[tohʷoːɾ̠ɨe]" },
		{ "chööjüdü", "[t͡ʃəːhɨɾ̠ɨ]" },
		{ "chööjüdüjüdü", "[t͡ʃəːhɨɾ̠ɨːhɨɾ̠ɨ]" },
		{ "juuwakadö", "[hʷuːwakaːɾ̠ə]" },
		{ "dadiweyudu", "[daɾ̠iːwejuːɾ̠u]" },
		{ "kadakadadi", "[kaɾ̠aːkaɾ̠aːɾ̠i]" },
		{ "aichudi edajö", "[ajt͡ʃuɾ̠i eɾ̠aːhə]" },
		{ "tüwe'mojo'e", "[tɨweʔmohʷoʔe]" },
		{ "Sedumeyanadi", "[seɾ̠uːmejaːnaɾ̠i]" }, --six or more open syllables in a row do not work correctly
		{ "wesuwadakadawö", "[wesuːwaɾ̠aːkaɾ̠aːwə]" },
        "Forms of j",
		{ "oneja", "[oneːha]" },
		{ "jhumma", "[çumma]" },
		{ "koijai", "[kojçaj]" },
		{ "dijushi", "[diçuːʃi]" },
		{ "ku'jö", "[kuʔhʷə]" },
		{ "ji'jö", "[hʷiʔçə]" },
		{ "ja'dötöme", "[hʷaʔdətəːme]" },
		{ "ta'jujuñe", "[taʔhʷuhʷuːɲe]" },
		{ "-joi", "[-hoj]" },
		{ "ekamjiyaka", "[ekamm̥ijaːka]" },
		{ "jadii_jadi", "[hʷaɾ̠iːhʷaɾ̠i]" },
        "Forms of y and i",
		{ "oy-", "[oj-]" },
		{ "ka'ya", "[kaʔɟa]" },
		{ "ye'kwana", "[ɟeʔkʷana]" },
		{ "o'joiye", "[oʔhʷojje]" },
        "Forms of w and u",
		{ "se'wadö", "[seʔwaɾ̠ə]" },
		{ "sawiya", "[saviːja]" },
		{ "shii awono ökato", "[ʃiː aβoːno əkaːto]" },
		{ "audaajö", "[awɾ̠ʷaːhə]" },
		{ "ta'kwañe", "[taʔkʷaɲe]" },
        "Forms of n",
		{ "nwawö", "[ŋwawə]" },
		{ "nñanno", "[nɲanno]" },
		{ "unke'ka", "[uŋkeʔka]" },
		{ "nün'e", "[nɨŋŋe]" },
		{ "pan", "[paŋ]" },
        "Forms of d",
		{ "dawade", "[dawaːɾ̠e]" },
		{ "sa'da'da", "[saʔdaʔda]" },
		{ "öddaajö", "[əddaːhə]" },
		{ "audaajö edemi'jüdü", "[awɾ̠ʷaːhə eɾ̠eːmiʔçɨɾ̠ɨ]" },
		{ "ödhajö", "[əðaːhə]" },
		{ "dhanwa", "[ðaŋwa]" },
		{ "a_d-", "[ad-]" },
        "Complex geminates",
		{ "össha", "[əʃʃa]" },
		{ "accha", "[att͡ʃa]" },
	}
--[[
	Additions take this form –
		{ "word", "IPA" },
		{ "", "" },
	Make sure to include the comma, or the module will return an error.
]]
	
	self:iterate(list, "check_output")
end

return tests