All tests passed. (refresh)
Text | Expected | Actual | Comments | |
---|---|---|---|---|
humuhumunukunukuā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 | |
ʻōmaʻimaʻi au | /ˌʔoː.ma.ʔiˈma.ʔi ˈau̯/ | /ˌʔoː.ma.ʔiˈma.ʔi ˈau̯/ | compound word, multiword | |
iā | /iˈaː/ | /iˈaː/ | syllable-final stress | |
ʻeleʻele | compound word, allophony | |||
ʻaleʻale | compound word, allophony | |||
pepeiao | glide insertion | |||
puana | glide insertion | |||
moana | glide insertion | |||
kea | glide insertion | |||
kau | rapid 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