Open main menu

1 test failed. (refresh)

Text Expected Actual Comments
test1_transliteration:
Passed tilivizyōn ti.li.viz.joːn ti.li.viz.joːn
Passed ʾinglīziyy ʔinɡliː.zijj ʔinɡliː.zijj
Text Expected Actual Comments
test_Arabic:
Passed طَبَّ(ṭabba) tˁab.ba tˁab.ba
Passed رُوسِيَا(rūsiyā) ruː.si.jaː ruː.si.jaː
Passed أَنْتَ(ʾanta) ʔan.ta ʔan.ta
Passed ذٰلِكَ(ḏālika) ðaː.li.ka ðaː.li.ka
Passed صَغِير(ṣaḡīr) sˁa.ɣiːr sˁa.ɣiːr
Passed إِصْبَع(ʾiṣbaʿ) ʔisˁ.baʕ ʔisˁ.baʕ
Passed عَلَى(ʿalā) ʕa.laː ʕa.laː
Passed جَزِيرَة(jazīra) d͡ʒa.ziː.ra d͡ʒa.ziː.ra
Passed أَرْبَعَة(ʾarbaʿa) ʔar.ba.ʕa ʔar.ba.ʕa
Passed حُبّ(ḥubb) ħubb ħubb
Passed عَرَبِيّ(ʿarabiyy) ʕa.ra.bijj ʕa.ra.bijj
Passed خَاصّ(ḵāṣṣ) xaːsˁsˁ xaːsˁsˁ
Passed خَاصَّة(ḵāṣṣa) xaːsˁ.sˁa xaːsˁ.sˁa
Failed يَوْمُ ٱلِٱثْنَيْنِ(yawmu l-iṯnayni) jaw.mu liθ.naj.ni jaw.mu l.iθ.naj.ni
Allah
Passed اللّٰه(allāh) aɫ.ɫaːh aɫ.ɫaːh special case
Passed عَبْدُ اللّٰه(ʿabdu llāh) ʕab.du‿ɫ.ɫaːh ʕab.du‿ɫ.ɫaːh special case
Passed لِلّٰه(lillāh) lil.laːh lil.laːh special case of the special case
Phrases
Passed الْمَمْلَكَة الْعَرَبِيَّة السُّعُودِيَّة(al-mamlaka(t) al-ʿarabiyya(t) as-suʿūdiyya) al.mam.la.ka‿l.ʕa.ra.bij.ja‿s.su.ʕuː.dij.ja al.mam.la.ka‿l.ʕa.ra.bij.ja‿s.su.ʕuː.dij.ja
Passed مَعَ اَلسَّلَامَة(maʿa s-salāma) ma.ʕa‿s.sa.laː.ma ma.ʕa‿s.sa.laː.ma
Passed لٰكِنَّ الرَّئِيسَ كَانَ أَذْكَى مِمَّا تَوَقَّعَ النَّاسُ(lākinna r-raʾīsa kāna ʾaḏkā mimmā tawaqqaʿa n-nāsu) laː.kin.na‿r.ra.ʔiː.sa kaː.na ʔað.kaː mim.maː ta.waq.qa.ʕa‿n.naː.su laː.kin.na‿r.ra.ʔiː.sa kaː.na ʔað.kaː mim.maː ta.waq.qa.ʕa‿n.naː.su
Passed بِسْمِ اللهِ الرَّحْمٰنِ الرَّحِيمِ(bismi llāhi r-raḥmāni r-raḥīmi) bis.mi‿l.laː.hi‿r.raħ.maː.ni‿r.ra.ħiː.mi bis.mi‿l.laː.hi‿r.raħ.maː.ni‿r.ra.ħiː.mi
Passed إِنْ شَاءَ ٱللَٰهُ(ʾin šāʾa llāhu) ʔin ʃaː.ʔa‿ɫ.ɫaː.hu ʔin ʃaː.ʔa‿ɫ.ɫaː.hu
Passed بِٱلْهَنَاءِ وَٱلشِّفَاء(bi-l-hanāʾi waš-šifāʾ) bil.ha.naː.ʔi waʃ.ʃi.faːʔ bil.ha.naː.ʔi waʃ.ʃi.faːʔ
vowel shortening
Passed فِي الْبَيْت(fī l-bayt) fi‿l.bajt fi‿l.bajt
Passed مَا ٱسْمُك(mā smuk) ma‿s.muk ma‿s.muk
Passed ذُو الْقَرْنَيْن(ḏū l-qarnayn) ðu‿l.qar.najn ðu‿l.qar.najn
Passed إِلَّا الله(ʾillā llāh) ʔil.la‿ɫ.ɫaːh ʔil.la‿ɫ.ɫaːh
Passed فِي ٱتِّحَادِنَا(fī ttiḥādinā) fi‿t.ti.ħaː.di.naː fi‿t.ti.ħaː.di.naː
Passed فِي الله(fī llāh) fi‿l.laːh fi‿l.laːh

local tests = require("Module:UnitTests")
local m_IPA = require("Module:ar-pronunciation")

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

local function not_Latin(text)
	return not string.find(text, "[a-z]")
end

local options = { display = tag_IPA, show_difference = true }
function tests:check_output(term, expected, comment)
	options.comment = comment
	local is_Arabic = not_Latin(term)
	self:equals(
		is_Arabic and m_IPA.link(term) or term,
		m_IPA.toIPA(is_Arabic and { Arabic = term } or { tr = term}, true),
		expected,
		options
	)
end

function tests:test_Arabic()
	local examples = {
		{ "طَبَّ", "tˁab.ba" },
		{ "رُوسِيَا", "ruː.si.jaː" },
		{ "أَنْتَ", "ʔan.ta" },
		{ "ذٰلِكَ", "ðaː.li.ka" },
		{ "صَغِير", "sˁa.ɣiːr" },
		{ "إِصْبَع", "ʔisˁ.baʕ" },
		{ "عَلَى", "ʕa.laː" },
		{ "جَزِيرَة", "d͡ʒa.ziː.ra" },
		{ "أَرْبَعَة", "ʔar.ba.ʕa" },
		{ "حُبّ", "ħubb" },
		{ "عَرَبِيّ", "ʕa.ra.bijj" },
		{ "خَاصّ", "xaːsˁsˁ" },
		{ "خَاصَّة", "xaːsˁ.sˁa" },
		{ "يَوْمُ ٱلِٱثْنَيْنِ", "jaw.mu liθ.naj.ni", "" },
		"Allah",
		{ "اللّٰه", "aɫ.ɫaːh", "special case" },
		{ "عَبْدُ اللّٰه", "ʕab.du‿ɫ.ɫaːh", "special case" },
		{ "لِلّٰه", "lil.laːh", "special case of the special case" },
		"Phrases",
		{
			"الْمَمْلَكَة الْعَرَبِيَّة السُّعُودِيَّة",
			"al.mam.la.ka‿l.ʕa.ra.bij.ja‿s.su.ʕuː.dij.ja"
		},
		{"مَعَ اَلسَّلَامَة", "ma.ʕa‿s.sa.laː.ma"},
		{
			"لٰكِنَّ الرَّئِيسَ كَانَ أَذْكَى مِمَّا تَوَقَّعَ النَّاسُ",
			"laː.kin.na‿r.ra.ʔiː.sa kaː.na ʔað.kaː mim.maː ta.waq.qa.ʕa‿n.naː.su"
		},
		{ "بِسْمِ اللهِ الرَّحْمٰنِ الرَّحِيمِ", "bis.mi‿l.laː.hi‿r.raħ.maː.ni‿r.ra.ħiː.mi" },
		{ "إِنْ شَاءَ ٱللَٰهُ", "ʔin ʃaː.ʔa‿ɫ.ɫaː.hu" },
		{ "بِٱلْهَنَاءِ وَٱلشِّفَاء", "bil.ha.naː.ʔi waʃ.ʃi.faːʔ" },
		"vowel shortening",
		{ "فِي الْبَيْت", "fi‿l.bajt" },
		{ "مَا ٱسْمُك", "ma‿s.muk" },
		{ "ذُو الْقَرْنَيْن", "ðu‿l.qar.najn" },
		{ "إِلَّا الله", "ʔil.la‿ɫ.ɫaːh" },
		{ "فِي ٱتِّحَادِنَا", "fi‿t.ti.ħaː.di.naː" },
		{ "فِي الله", "fi‿l.laːh" },
--[[	Copy the following to add more examples:
		{ "", "" },
]]
	}
	
	self:iterate(examples, "check_output")
end

function tests:test1_transliteration()
	local examples = {
		{ "tilivizyōn", "ti.li.viz.joːn" },
		{ "ʾinglīziyy", "ʔinɡliː.zijj" },		
--[[	Copy the following to add more examples:
		{ "", "" },
]]
	}
	
	self:iterate(examples, "check_output")
end

return tests