Module:Hebr-Arab-translit/testcases

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

This is the unit-testing module for Module:Hebr-Arab-translit.

39 of 58 tests failed. (refresh)

TextExpectedActual
test_translit_hebrew:
Failedבַּיִתبَيِتبּَيِث
Failedבֵּיתبֵּيث
Failedעַכּוֹعَكو
Passedבָּתִּיםبּٰتِيمبּٰتِيم
Failedמַחֲנֶהmaḥăneمَحֲنֶه
Failedבָּרָאبּٰرٰءبּٰرٰأ
Failedרֶגֶלreḡelرֶجֶل
Failedכֹּהֵןkōhēnكوּهֵن
Failedמֶלֶךְmeleḵمֶلֶكْ
Passedמַמְלָכָהمَمْلٰكٰهمَمْلٰكٰه
Passedהַמַּמְלָכָהهَمּَمْلٰكٰههَمּَمْلٰكٰه
Passedהַלְּלוּיָהּهَلּْلُويٰهּهَلּْلُويٰهּ
Passedהַלְלוּיָהּهَلْلُويٰهּهَلْلُويٰهּ
Passedיָדַעيٰذَعيٰذَع
Passedשָׁבוּעַشٰبُوعَشٰبُوعَ
Passedרוּחַرُوحَرُوحَ
Failedגָּבֹהַּجٰبوهּَجּٰبوهּَ
Passedמָשִׁיחַمٰشِيحَمٰشِيحَ
Failedרֵיחַrēaḥرֵيحَ
Failedשָׂדֶהśāḏeسٰذֶه
Failedשְׂדֵהśəḏēسْذֵه
Failedבָּנַיbānayبּٰنَي
Failedבְּנֵיbənēبּْنֵي
Passedצָרְכִּיصٰرْكِيصٰرْكِي
Passedחָכְמָהحٰكْمٰهحٰكْمٰه
Passedשִׁפְרָהشِفْرٰهشِفْرٰه
Failedשָׁכְבְּךָšoḵbəḵāشٰكْبּْكٰ
Passedנִשְׂרְפָהنِسْرْفٰهنِسْرْفٰه
Failedבָּנָיוbānāwبּٰنٰيو
Failedבָּנֶיהָbānehāبּٰنֶيهٰ
Passedמִצְוֹתمِصْوثمِصْوث
Failedזִוּוּגزُِوُوجزُِوُوج
Failedרֹאשׁrōšروأش
Failedרֵאשִׁיתrēšīṯرֵأشِيث
Failedרִאשׁוֹןrīšōnرِأشون
Passedמְלָאכָהمْلٰأكٰهمْلٰأكٰه
Failedמְלֶאכֶתməleḵeṯمْلֶأكֶث
Failedחֵטְאḥēṭحֵطْأ
Failedבָּרָאתָbārāṯāبּٰرٰأثٰ
Failedחַטֹּאותḥaṭṭōṯحَطوּأوث
Failedיְראוּyərūيْرأُو
Failedוַיֶּאְסֹרwayyeʾsōrوَيֶּأْسور
Failedהָחְלַטhoḥlaṭهٰحْلَط
Failedוַיֵּבְךְּwayyēḇkوَيֵּبْكْ
Failedאַרְאֶךָּʾarʾekkāأَرْأֶكٰ
Failedוַיַּשְׁקְwayyašqوَيּَشْقْ
Failedאַתְּʾattأَتْ
Failedוּוָווֹūwāwōُووٰوو
Failedוָוwāwوٰو
Failedתָּוtāwتٰو
Failedקַוqawقَو
Failedלָאוlāwلٰأو
Passedחַיحَيحَي
Passedחָיحٰيحٰي
Passedפִּיוفِيوفِيو
Failedכִּסְלֵוkislēwكِسْلֵو
Passedקדמוניقذمونيقذموني
Failedאלרגיהألرجيةألرجيه

local tests = require('Module:UnitTests')
local transliterate = require('Module:Hebr-Arab-translit').tr

local function tag(text)
	return '<span class="Hebr" lang="he">' .. text .. '</span>'
end

local options = { display = tag }

--TO DO
function tests:do_test_translit(arab, hebr, xlit)
	self:equals('<span class="Arab" lang="ar">[[' .. arab .. '#Hebrew|' .. arab .. ']]</span>', 
		transliterate(arab, 'he', 'Hebr'),
		hebr, -- expected script
		options)
end

function tests:test_translit_hebrew()
	local examples = {
		{ "בַּיִת", "بَيِت" }, --j
		{ "בֵּית", "" },
        { "עַכּוֹ", ""},
		{ "בָּתִּים", "بּٰتِيم" },
		{ "מַחֲנֶה", "maḥăne" },
		{ "בָּרָא", "بּٰرٰء" },
		{ "רֶגֶל", "reḡel" },
		{ "כֹּהֵן", "kōhēn" },
		{ "מֶלֶךְ", "meleḵ" },
		{ "מַמְלָכָה", "مَمْلٰكٰه" },
		{ "הַמַּמְלָכָה", "هَمּَمْلٰكٰه" },
		{ "הַלְּלוּיָהּ", "هَلּْلُويٰهּ" },
		{ "הַלְלוּיָהּ", "هَلْلُويٰهּ" },
		{ "יָדַע", "يٰذَع" },
		{ "שָׁבוּעַ", "شٰبُوعَ" },
		{ "רוּחַ", "رُوحَ" },
		{ "גָּבֹהַּ", "جٰبوهּَ" },
		{ "מָשִׁיחַ", "مٰشِيحَ" },
		{ "רֵיחַ", "rēaḥ" },
		{ "שָׂדֶה", "śāḏe" },
		{ "שְׂדֵה", "śəḏē" },
		{ "בָּנַי", "bānay" },
		{ "בְּנֵי", "bənē" },
		{ "צָרְכִּי", "صٰرْكِي" },
		{ "חָכְמָה", "حٰكْمٰه",},
		{ "שִׁפְרָה", "شِفْرٰه" },
		{ "שָׁכְבְּךָ", "šoḵbəḵā" },
		{ "נִשְׂרְפָה", "نِسْرْفٰه" },
		{ "בָּנָיו", "bānāw" },
		{ "בָּנֶיהָ", "bānehā" },
		{ "מִצְוֹת", "مِصْوث" },
		{ "זִוּוּג", "زُِوُوج" },
		{ "רֹאשׁ", "rōš" },
		{ "רֵאשִׁית", "rēšīṯ" },
		{ "רִאשׁוֹן", "rīšōn" },
		{ "מְלָאכָה", "مْلٰأكٰه" },
		{ "מְלֶאכֶת", "məleḵeṯ" },
		{ "חֵטְא", "ḥēṭ" },
		{ "בָּרָאתָ", "bārāṯā" },
		{ "חַטֹּאות", "ḥaṭṭōṯ" },
		{ "יְראוּ", "yərū" },
		{ "וַיֶּאְסֹר", "wayyeʾsōr" },
		{ "הָחְלַט", "hoḥlaṭ" },
		{ "וַיֵּבְךְּ", "wayyēḇk" },
		{ "אַרְאֶךָּ", "ʾarʾekkā" },
		{ "וַיַּשְׁקְ", "wayyašq" },
		{ "אַתְּ", "ʾatt" },
		{ "וּוָווֹ", "ūwāwō" },
		{ "וָו", "wāw" },
		{ "תָּו", "tāw" },
		{ "קַו", "qaw" },
		{ "לָאו", "lāw" },
		{ "חַי", "حَي" },
		{ "חָי", "حٰي", "pausal" },
		{ "פִּיו", "فِيو" },
		{ "כִּסְלֵו", "kislēw" },
        { 'קדמוני', "قذموني"},
        { 'אלרגיה', "ألرجية"},
	}
	self:iterate(examples, 'do_test_translit')
end
return tests