Module:haw-IPA/testcases

Hello, you have come here looking for the meaning of the word Module:haw-IPA/testcases. In DICTIOUS you will not only get to know all the dictionary meanings for the word Module:haw-IPA/testcases, but we will also tell you about its etymology, its characteristics and you will know how to say Module:haw-IPA/testcases in singular and plural. Everything you need to know about the word Module:haw-IPA/testcases you have here. The definition of the word Module:haw-IPA/testcases will help you to be more precise and correct when speaking or writing your texts. Knowing the definition ofModule:haw-IPA/testcases, as well as those of other words, enriches your vocabulary and provides you with more and better linguistic resources.

All tests passed. (refresh)

TextExpectedActualComments
test_all:
Passedhumuhumunukunukuāpuaʻa/ˌhu.muˌhu.muˌnu.kuˌnu.kuˌaː.puˈa.ʔa//ˌhu.muˌhu.muˌnu.kuˌnu.kuˌaː.puˈa.ʔa/compound word
Passedʻōmaʻimaʻi au/ˌʔoː.ma.ʔiˈma.ʔi ˈau̯//ˌʔoː.ma.ʔiˈma.ʔi ˈau̯/compound word, multiword
Passed/iˈaː//iˈaː/syllable-final stress
Passedʻeleʻelecompound word, allophony
Passedʻaleʻalecompound word, allophony
Passedpepeiaoglide insertion
Passedpuanaglide insertion
Passedmoanaglide insertion
Passedkeaglide insertion
Passedkaurapid pronunciation

local tests = require("Module:UnitTests")
local ipa = require("Module:haw-IPA")
local link = require("Module:links")

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

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

function tests:check_output(term, is_phonetic, expected, comment)
	local actual = ipa.toIPA(term, is_phonetic)
	if ipa.rapid(ipa.toIPA(term, is_phonetic)) ~= actual then
		actual = actual .. ", " .. ipa.rapid(ipa.toIPA(term, is_phonetic))
	end

	self:equals(
		link.full_link({ term = mw.ustring.gsub(term, "", ""), lang = lang, sc = sc } ),
		tag_IPA(actual, is_phonetic),
		tag_IPA(expected, is_phonetic),
		{ comment = comment }
	)
end

function tests:test_all()
	examples = {
		{ "humu+humu+nuku+nuku+āpu+aʻa", false, "ˌhu.muˌhu.muˌnu.kuˌnu.kuˌaː.puˈa.ʔa", "compound word" },
		{ "ʻōma+ʻimaʻi au", false, "ˌʔoː.ma.ʔiˈma.ʔi ˈau̯", "compound word, multiword" },
		{ "iā", false, "iˈaː", "syllable-final stress" },
		{ "ʻele+ʻele", true, "ˌʔɛ.lɛˈʔɛ.lɛ", "compound word, allophony" },
		{ "ʻale+ʻale", true, "ˌʔɐ.leˈʔɐ.le", "compound word, allophony" },
		{ "pepeiao", true, "pe.pejˈjɐo̯", "glide insertion" },
		{ "puana", true, "puˈwɐ.nə", "glide insertion" },
		{ "moana", true, "moˈwɐ.nə", "glide insertion" },
		{ "kea", true, "ˈkɛ.jə", "glide insertion"},
		{ "kau", true, "ˈkɐw, ˈkɔw", "rapid pronunciation" },
	}

	self:iterate(examples, "check_output")
end

return tests