Module:qhv-pron/testcases: Difference between revisions

From Linguifex
Jump to navigation Jump to search
No edit summary
No edit summary
Line 30: Line 30:
function tests:test_modern()
function tests:test_modern()
local list = {
local list = {
{"drakarys", "draˈkaɾys"},
{"drakarys", "dra.ˈka.ɾys"},
{"valonqar", "vaˈloɴqar"},
{"valonqar", "va.ˈloɴ.qar"},
{"Thoros", "ˈθoɾos"},
{"Thoros", "ˈθo.ɾos"},
{"arakh", "aˈɾax"},
{"arakh", "a.ˈɾax"},
{"ēngos", "ˈeːŋɡos"},
{"ēngos", "ˈeːŋ.ɡos"},
{"amīvindigon", "amiːˈvindiɡon"},
{"amīvindigon", "a.miː.ˈvin.di.ɡon"},
{"ojehiknon", "ojeˈhiknon"},
{"ojehiknon", "o.je.ˈhik.non"},
{"pōja", "ˈpoːja"},
{"pōja", "ˈpoː.ja"},
{"riña", "ˈriɲa"},
{"riña", "ˈri.ɲa"},
{"zirȳla", "ziˈɾyːla"},
{"zirȳla", "zi.ˈɾyː.la"},
{"ipradis", "iˈpradis"},
{"ipradis", "i.ˈpra.dis"},
}
}
self:iterate(list, "check_output")
self:iterate(list, "check_output")
Line 47: Line 47:
function tests:test_antique()
function tests:test_antique()
local list = {
local list = {
{"vējōñe", "veːˈjoːɲe"},
{"vējōñe", "veː.ˈjoː.ɲe"},
{"vōljes", "ˈwoːʎes"},
{"vōljes", "ˈwoː.ʎes"},
{"vumbiarzy", "ˈwumbi͜arzy"},
{"vumbiarzy", "ˈwum.bi͜ar.zy"},
{"vȳs", "ˈɥyːs"},
{"vȳs", "ˈɥyːs"},
{"ȳgha", "ˈyːɣa"},
{"ȳgha", "ˈyː.ɣa"},
{"vajie", "ˈɥaɟi͜e"},
{"vajie", "ˈɥa.ɟi͜e"},
{"vūjigon", "ˈwuːɟiɡon"},
{"vūjigon", "ˈwuː.ɟi.ɡon"},
{"qrillaodikio", "qrilˈlao̯diki͜o"},
{"qrillaodikio", "qril.ˈlao̯.di.ki͜o"},
}
}
self:iterate(list, "check_output2")
self:iterate(list, "check_output2")

Revision as of 19:40, 7 February 2021


19 tests failed. (refresh)
Text Expected Actual
test_antique:
Failed vējōñe veː.ˈjoː.ɲe veːˈjoːɲe
Failed vōljes ˈwoː.ʎes ˈwoːʎes
Failed vumbiarzy ˈwum.bi͜ar.zy wumˈbi͜arzy
Failed vȳs ˈɥyːs ɥyːs
Failed ȳgha ˈyː.ɣa ˈyːɣa
Failed vajie ˈɥa.ɟi͜e ˈɥaɟi͜e
Failed vūjigon ˈwuː.ɟi.ɡon ˈwuːɟiɡon
Failed qrillaodikio qril.ˈlao̯.di.ki͜o qrilˈlao̯diki͜o
Text Expected Actual
test_modern:
Failed drakarys dra.ˈka.ɾys draˈkaɾys
Failed valonqar va.ˈloɴ.qar vaˈloɴqar
Failed Thoros ˈθo.ɾos ˈθoɾos
Failed arakh a.ˈɾax ˈaɾax
Failed ēngos ˈeːŋ.ɡos ˈeːŋɡos
Failed amīvindigon a.miː.ˈvin.di.ɡon amiːˈvindiɡon
Failed ojehiknon o.je.ˈhik.non ojeˈhiknon
Failed pōja ˈpoː.ja ˈpoːja
Failed riña ˈri.ɲa ˈriɲa
Failed zirȳla zi.ˈɾyː.la ziˈɾyːla
Failed ipradis i.ˈpra.dis iˈpradis

local tests = require('Module:UnitTests')
local m_IPA = require('Module:qhv-pron')

local function IPA_style(IPA)
	return '<span style="font-size:110%;font-family:Gentium,\'DejaVu Sans\',\'Segoe UI\',sans-serif>' .. IPA .. '</span>'
end

local function linkup(text)
	return "[[Contionary:" .. text .. "#High Valyrian|" .. text .. "]]"
end

function tests:check_output(term, expected)
	return tests:equals(
		linkup(term),
		m_IPA.crux(term),
		expected,
		{ display = IPA_style }
	)
end

function tests:check_output2(term, expected)
	return tests:equals(
		linkup(term),
		m_IPA.antique_crux(term),
		expected,
		{ display = IPA_style }
	)
end

function tests:test_modern()
	local list = {
		{"drakarys", "dra.ˈka.ɾys"},
		{"valonqar", "va.ˈloɴ.qar"},
		{"Thoros", "ˈθo.ɾos"},
		{"arakh", "a.ˈɾax"},
		{"ēngos", "ˈeːŋ.ɡos"},
		{"amīvindigon", "a.miː.ˈvin.di.ɡon"},
		{"ojehiknon", "o.je.ˈhik.non"},
		{"pōja", "ˈpoː.ja"},
		{"riña", "ˈri.ɲa"},
		{"zirȳla", "zi.ˈɾyː.la"},
		{"ipradis", "i.ˈpra.dis"},
	}
	self:iterate(list, "check_output")
end

function tests:test_antique()
	local list = {
		{"vējōñe", "veː.ˈjoː.ɲe"},
		{"vōljes", "ˈwoː.ʎes"},
		{"vumbiarzy", "ˈwum.bi͜ar.zy"},
		{"vȳs", "ˈɥyːs"},
		{"ȳgha", "ˈyː.ɣa"},
		{"vajie", "ˈɥa.ɟi͜e"},
		{"vūjigon", "ˈwuː.ɟi.ɡon"},
		{"qrillaodikio", "qril.ˈlao̯.di.ki͜o"},
	}
	self:iterate(list, "check_output2")
end

return tests