Module:User:Fenakhay/mt-IPA/testcases

From Wiktionary, the free dictionary
Jump to navigation Jump to search

2 of 58 tests failed. (refresh)

TextExpectedActualComments
test_pron:
Passedgħoxxɔˤːʃɔˤːʃ
Passedgħoxa (respelled ḡoxa)ɔˤːʃaɔˤːʃaarchaic
Passedgħoxa (respelled ḡoxa)ɣɔʃaɣɔʃaarchaic rural
Passedbajdbajtbajt
Passedbgħid (respelled bgħîd)bəˤjtbəˤjt
PassedAlla jagħtih il-ġenna (respelled Alla jagħtîh il-ġenna)alla jaˤːtɪːħ ɪld͡ʒɛnnaalla jaˤːtɪːħ ɪld͡ʒɛnna
Passedbaħarbaħarbaħar
Passedbiebbɪːpbɪːp
Passedbagħatbaˤːtbaˤːt
Passedbagħal (respelled baḡal)baˤːlbaˤːlarchaic
Passedbagħal (respelled baḡal)baɣalbaɣalarchaic rural
Passedbgħula (respelled bḡûla)bəˤwlabəˤwlaarchaic
Passedbgħula (respelled bḡûla)bɣuːlabɣuːlaarchaic rural
Passedbejjiegħbɛjjɪːħbɛjjɪːħ
Passedbegħtubɛˤːtubɛˤːtu
Passedgħoxrin (respelled għoxrîn)ɔˤːʃriːnɔˤːʃriːn
Passedgħira (respelled ḡîra)əˤjraəˤjraarchaic
Passedgħira (respelled ḡîra)ɣiːraɣiːraarchaic rural
Passedikrahɪkraħɪkraħ
Passedjixbhu (respelled jixbħu)jɪʃpħujɪʃpħu
Passedheddedɛːddɛtɛːddɛt
Passedfehmetfɛːmɛtfɛːmɛt
Passedjibniha (respelled jibnîha)jɪbnɪːjajɪbnɪːja
Passednħobbuhom (respelled nħobbûhom)(ɪ)nħɔbbuːwɔm(ɪ)nħɔbbuːwɔm
Passedrahom (respelled râhom)rɔːmrɔːm
Failedftehim (respelled ftehîm)ftɛjm, ftɛjiːmftɛːiːm
Passedlbieraħ(ɪ)lbɪːraħ(ɪ)lbɪːraħ
Passedgħandek bżonn għajnuna (respelled għandek bżonn għajnûna)aˤːndɛk bzɔnn aˤːjnuːnaaˤːndɛk bzɔnn aˤːjnuːna
Passedtista’ tgħinni (respelled tista' tgħînni)tɪstaˤ təˤjnnɪtɪstaˤ təˤjnnɪ
Passedattakkaha (respelled attakkâha)attakkaːattakkaː
Passedħtabtuħtaptuħtaptu
Passeddsatax (respelled dsatâx)t͡sataːʃt͡sataːʃ
Passedbgħadt (respelled bḡadt)baˤːtbaˤːtarchaic
Passedbgħadt (respelled bḡadt)bɣatbɣatarchaic rural
Passedtelevixin (respelled televižin)tɛlɛvɪʒɪntɛlɛvɪʒɪn
Passedbgħadtu (respelled bḡadtu)baˤːttubaˤːttuarchaic
Passedbgħadtu (respelled bḡadtu)bɣattubɣattuarchaic rural
Passedobogħdu (respelled oboḡdu)ɔbɔˤːduɔbɔˤːduarchaic
Passedobogħdu (respelled oboḡdu)ɔbɔɣduɔbɔɣduarchaic rural
Passedobogħtu (respelled oboḡtu)ɔbɔˤːtuɔbɔˤːtuarchaic
Passedobogħtu (respelled oboḡtu)ɔbɔħtuɔbɔħtuarchaic rural
Passednnazzjonalizza(ɪ)nnatt͡sjɔnalɪdd͡za(ɪ)nnatt͡sjɔnalɪdd͡za
Passednazzjonalizzazzjonijietnatt͡sjɔnalɪdd͡zatt͡sjɔnɪjɪːtnatt͡sjɔnalɪdd͡zatt͡sjɔnɪjɪːt
Passedġġeneralizzajtu(ɪ)dd͡ʒɛnɛralɪdd͡zajtu(ɪ)dd͡ʒɛnɛralɪdd͡zajtu
Passedtagħhataħħataħħa
Passedtiegħektɪːəˤktɪːəˤk
Passedtiegħutɪːəˤwtɪːəˤw
Passedspalltispalltɪspalltɪ
Passedżbajjebzbajjɛpzbajjɛp
Passedjisimgħujɪsɪməˤwjɪsɪməˤw
Passedqabilhaʔabɪlaʔabɪla
Passedjarawhx (respelled jarawħx)jarawħʃjarawħʃ
Failedgħereqɛˤːrɛʔəˤrɛʔ
Passedgħereq (respelled ḡèreq)ɛˤːrɛʔɛˤːrɛʔarchaic
Passedgħereq (respelled ḡèreq)ɣɛrɛʔɣɛrɛʔarchaic rural
Passedbigħ (respelled bîgħ)bɪːħbɪːħ
Passedpitgħada (respelled pitḡada)pɪtaˤːdapɪtaˤːdaarchaic
Passedpitgħada (respelled pitḡada)pɪdɣadapɪdɣadaarchaic rural

local tests = require("Module:UnitTests")
local m_IPA = require("Module:User:Fenakhay/mt-IPA")
local m_links = require("Module:links")
local lang = require("Module:languages").getByCode("mt")

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

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

local options = { display = tag_IPA }

function tests:check_ipa(term, expected_archaic, expected_rural, respelling)
	if respelling == nil then 
		respelling = expected_rural 
		expected_rural = nil 
	end
	local archaic = m_IPA.mt_IPA(respelling or term, "archaic")
	local rural_archaic = m_IPA.mt_IPA(respelling or term, "rural")
	local show_both = archaic ~= rural_archaic
	
	options.comment = show_both and "archaic"
	self:equals(
		link(term) .. (respelling and (" (respelled " .. respelling .. ")") or ""),
		archaic,
		expected_archaic,
		options
	)
	if show_both then
		options.comment = show_both and "archaic rural"
		self:equals(
			link(term) .. (respelling and (" (respelled " .. respelling .. ")") or ""),
			rural_archaic,
			expected_rural,
			options
		)
	end
end

function tests:test_pron()
	examples = {
		{ "għoxx", "ɔˤːʃ"},
		{ "għoxa", "ɔˤːʃa", "ɣɔʃa", "ḡoxa"},
		{ "bajd", "bajt"},
		{ "bgħid", "bəˤjt", "bgħîd"},
		{ "Alla jagħtih il-ġenna", "alla jaˤːtɪːħ ɪld͡ʒɛnna", "Alla jagħtîh il-ġenna"},
		{ "baħar", "baħar"},
		{ "bieb", "bɪːp"},
		{ "bagħat", "baˤːt"},
		{ "bagħal", "baˤːl", "baɣal", "baḡal"},
		{ "bgħula", "bəˤwla", "bɣuːla", "bḡûla"},
		{ "bejjiegħ", "bɛjjɪːħ"},
		{ "begħtu", "bɛˤːtu"},
		{ "għoxrin", "ɔˤːʃriːn", "għoxrîn"},
		{ "għira", "əˤjra", "ɣiːra", "ḡîra"},
		{ "ikrah", "ɪkraħ"},
		{ "jixbhu", "jɪʃpħu", "jixbħu"},
		{ "hedded", "ɛːddɛt"},
		{ "fehmet", "fɛːmɛt"},
		{ "jibniha", "jɪbnɪːja", "jibnîha"},
		{ "nħobbuhom", "(ɪ)nħɔbbuːwɔm", "nħobbûhom"},
		{ "rahom", "rɔːm", "râhom"},
		{ "ftehim", "ftɛjm, ftɛjiːm", "ftehîm"},
		{ "lbieraħ", "(ɪ)lbɪːraħ"},
		{ "għandek bżonn għajnuna", "aˤːndɛk bzɔnn aˤːjnuːna", "għandek bżonn għajnûna"},
		{ "tista' tgħinni", "tɪstaˤ təˤjnnɪ", "tista' tgħînni"},
		{ "attakkaha", "attakkaː", "attakkâha"},
		{ "ħtabtu", "ħtaptu"},
		{ "dsatax", "t͡sataːʃ", "dsatâx"},
		{ "bgħadt", "baˤːt", "bɣat", "bḡadt"},
		{ "televixin", "tɛlɛvɪʒɪn", "televižin"},
		{ "bgħadtu", "baˤːttu", "bɣattu", "bḡadtu"},
		{ "obogħdu", "ɔbɔˤːdu", "ɔbɔɣdu", "oboḡdu"},
		{ "obogħtu", "ɔbɔˤːtu", "ɔbɔħtu", "oboḡtu"},
		{ "nnazzjonalizza", "(ɪ)nnatt͡sjɔnalɪdd͡za"},
		{ "nazzjonalizzazzjonijiet", "natt͡sjɔnalɪdd͡zatt͡sjɔnɪjɪːt"},
		{ "ġġeneralizzajtu", "(ɪ)dd͡ʒɛnɛralɪdd͡zajtu"},
		{ "tagħha", "taħħa"},
		{ "tiegħek", "tɪːəˤk"},
		{ "tiegħu", "tɪːəˤw"},
		{ "spallti", "spalltɪ"},
		{ "żbajjeb", "zbajjɛp"},
		{ "jisimgħu", "jɪsɪməˤw"},
		{ "qabilha", "ʔabɪla"},
		{ "jarawhx", "jarawħʃ", "jarawħx"},
		{ "għereq", "ɛˤːrɛʔ"},
		{ "għereq", "ɛˤːrɛʔ", "ɣɛrɛʔ", "ḡèreq"},
		{ "bigħ", "bɪːħ", "bîgħ"},
		{ "pitgħada", "pɪtaˤːda", "pɪdɣada", "pitḡada"},
	}

	tests:iterate(examples, "check_ipa")
end

return tests