Jump to content

Module:ps-translit/testcases

From Wiktionary, the free dictionary

3 of 69 tests failed. (refresh)

TextExpectedActual
test_translit_arabic:
Passedاللهallâhallâh
Passedاَذهانaẕhânaẕhân
Passedاَژدَهارaždahâraždahâr
Passedغَټهǧaṭaǧaṭa
Passedغَټَهǧaṭahǧaṭah
Passedغَټَهْǧaṭahǧaṭah
Passedغَټْهǧaṭhǧaṭh
Passedدْوهdwadwa
Passedدوهdohdoh
Passedدُوهduhduh
Passedاوهohoh
Passedاَوهawaawa
Passedکْيهkyakya
Passedکيهkihkih
Passedايهihih
Passedاَيهayaaya
Passedايمانimânimân
Passedاوسيږېosiǵeosiǵe
Passedاېرانerânerân
Passedدُویduyduy
Passedزویzoyzoy
Passedځایźâyźây
Passedيُوسٙفزیyusëfzayyusëfzay
Passedدےdayday
Passedبېیbeybey
Passedڅْویśwayśway
Passedشْيیšyayšyay
Passedویwayway
Passedويwiwi
Passedيیyayyay
Passedيئyëyyëy
Passedپَلَوpalawpalaw
Passedاُووۀuwëuwë
Passedنِياniâniâ
Passedؤ
Passedيوyoyo
Passedبايوbâyobâyo
Passedباويbâwibâwi
Passedوايُوwâyuwâyu
Passedبَيوتbayotbayot
Passedکِيوډkioḍkioḍ
Failedکيوْډkiwḍkyoḍ
Passedکيوډkyoḍkyoḍ
Passedکْيوډkyoḍkyoḍ
Passedکُوِيډkuiḍkuiḍ
Failedکويْډkoyḍkoiḍ
Passedکُويْډkuyḍkuyḍ
Passedکْويډkwiḍkwiḍ
Passedکويډkoyḍkoyḍ
Failedکيويkiwikyoy
Passedکِيويkioykioy
Passedکْيويkyoykyoy
Passedووwowo
Passedپِنځۀpĭnźëpĭnźë
Passedګُلُونهgŭlunagŭluna
Passedحِسّهḥĭssaḥĭssa
Passedبيزوbizobizo
Passedپٙښتوpëx̌topëx̌to
Passedخوَړٙلxwaṛëlxwaṛël
Passedخَلاصxalâṣxalâṣ
Passedدْرېdredre
Passedډَيرḍayrḍayr
Passedسپينspinspin
Passedکَچالُوkačâlukačâlu
Passedدوبيdobidobi
Passedنْجٙلۍnjëlëynjëlëy
Passedوايئwâyëywâyëy
Passedورورwrorwror
Passedهَلٙکhalëkhalëk

-- Unit tests for [[Module:ps-translit]]. Refresh page to run tests.
local tests = require('Module:UnitTests')
local ps_translit = require('Module:ps-translit')

local full_link = require('Module:links').full_link
local ps = require('Module:languages').getByCode('ps')

local function link(word)
	return full_link{ term = word, lang = ps, tr = "-" }
end

--TO DO
function tests:do_test_translit(arabic, roman)
	self:equals(link(arabic), ps_translit.tr(arabic, 'ps', 'ps-Arab'), roman)
end

function tests:test_translit_arabic()
	local examples = {
		-- h sematnics
		{"الله", "allâh"},
		{"اَذهان", "aẕhân"},
		{"اَژدَهار", "aždahâr"},
    	{"غَټه", "ǧaṭa"},
    	{"غَټَه", "ǧaṭah"},
    	{"غَټَهْ", "ǧaṭah"},
    	{"غَټْه", "ǧaṭh"},
    	{"دْوه", "dwa"},
    	{"دوه", "doh"},
    	{"دُوه", "duh"},
    	{"اوه", "oh"},
    	{"اَوه", "awa"},
    	{"کْيه", "kya"},
    	{"کيه", "kih"},
    	{"ايه", "ih"},
    	{"اَيه", "aya"},
    	
    	-- inital alif
		{"ايمان", "imân"},
    	{"اوسيږې", "osiǵe"},
    	{"اېران", "erân"},
    	
    	-- final y dipthongs
		{"دُوی", "duy"},
		{"زوی", "zoy"},
		{"ځای", "źây"},
		{"يُوسٙفزی", "yusëfzay"},
    	{"دے", "day"},
    	{"بېی", "bey"},
    	{"څْوی", "śway"},
    	{"شْيی", "šyay"},
    	{"وی", "way"},
    	{"وي", "wi"},
    	{"يی", "yay"},
    	{"يئ", "yëy"},
		
		-- other dipthongs
		{"پَلَو", "palaw"},
		{"اُووۀ", "uwë"},
		{"نِيا", "niâ"},
		{"ؤ", "wë"},
		
		-- u/y stuff
		{"يو", "yo"},
		{"بايو", "bâyo"},
		{"باوي", "bâwi"},
		{"وايُو", "wâyu"},
		{"بَيوت", "bayot"},
		{"کِيوډ", "kioḍ"},
		{"کيوْډ", "kiwḍ"},
		{"کيوډ", "kyoḍ"},
		{"کْيوډ", "kyoḍ"},
		{"کُوِيډ", "kuiḍ"},
		{"کويْډ", "koyḍ"},
		{"کُويْډ", "kuyḍ"},
		{"کْويډ", "kwiḍ"},
		{"کويډ", "koyḍ"},
		{"کيوي", "kiwi"},
		{"کِيوي", "kioy"},
		{"کْيوي", "kyoy"},
		{"وو", "wo"},
		
		-- short vowels
		{"پِنځۀ", "pĭnźë"},
		{"ګُلُونه", "gŭluna"},
		
		-- miscellaneous
		{"حِسّه", "ḥĭssa"},
    	{"بيزو", "bizo"},
    	{"پٙښتو", "pëx̌to"},
    	{"خوَړٙل", "xwaṛël"},
    	{"خَلاص", "xalâṣ"},
    	{"دْرې", "dre"},
    	{"ډَير", "ḍayr"},
    	{"سپين", "spin"},
    	{"کَچالُو", "kačâlu"},
    	{"دوبي", "dobi"},
    	{"نْجٙلۍ", "njëlëy"},
    	{"وايئ", "wâyëy"},
    	{"ورور", "wror"},
    	{"هَلٙک", "halëk"},
	}
	
	self:iterate(examples, "do_test_translit")
end
 
return tests