Module:User:OblivionKhorasan/pa-IPA-test/testcases

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

37 of 67 tests failed. (refresh)

TermRespellingExpectedActualDiffers atComments
test_classical_persian:
Failedخوشxwśxʊʃxwś2
Failedجھانجر`jHāṉjHarˈd͡ʒʱãːn̠.d͡ʒəɾᵊˈd͡ʒʱaṉd͡ʒʱəɾ6
Failedساوݨ`sāvaNˈsaː.ʋəɳᵊˈsa.wəɳ4
FailedمٹیارmuTī`ārmʊ.ʈi.ˈjaːɾᵊmʊ.ʈi.ˈaɾ8
Failedلیا`leāˈleː.aːˈlea4
Failedلیاle`āle.ˈaːleˈa3
Failedکڑوا`kaRvāˈkəɽᵊ.ʋaːˈkəɽ.wa5
FailedملاوݨاmilāvNāˈmɪ.laːʋᵊ.ɳaːmɪ.law.ɳa1
TermRespellingExpectedActualDiffers atComments
test_dari_persian:
Failedخوشxwašxʊʃš3
Passedخوابxwābxɑːbxɑːb
Passedابرنواخترabar-naw-ax`tarʔä.bäɾ.näw.ʔäx.t̪ʰǽɾʔä.bäɾ.näw.ʔäx.t̪ʰǽɾ
Passedابراهیمibrā`hīmʔɪb.ɾɑː.ɦíːmʔɪb.ɾɑː.ɦíːm
Passedامامi`māmʔɪ.mɑ́ːmʔɪ.mɑ́ːm
Failedپیشواpēš`vāpʰeːʃ.wɑ́ːpʰeːš.wɑ́ː5
Passedنوnawnäwnäw
Failedمستعمرهmusta'ma`ramʊs.t̪ʰäʔ.mä.ɾǽmʊs.t̪ʰä'.mä.ɾǽ9
Passedآزادā`zādʔɑː.zɑ́ːd̪ʔɑː.zɑ́ːd̪
Passedقولqawlqäwlqäwl
Passedدولتdawlatd̪äw.lät̪d̪äw.lät̪
Passedآخورāxwarʔɑː.xʊɾʔɑː.xʊɾ
Failedلغوlağwläɣwğw3
Passedگورgawrɡäwɾɡäwɾ
Failedمعتدلmu'tadilmo̞ʔ.t̪ʰä.d̪ɪlmo̞'.t̪ʰä.d̪ɪl4
Passedخویxwayxʊjxʊj
Passedخویدxwēdxeːd̪xeːd̪
TermRespellingExpectedActualDiffers atComments
test_iranian_persian:
Failedخوشxwašxoʃxoš3
Passedخوابxwābxɒːb̥xɒːb̥
Passedابرنواخترabar.naw.ax.`tarʔæ.bæɹ.now.ʔæx.t̪ʰǽɹʔæ.bæɹ.now.ʔæx.t̪ʰǽɹ
Passedابراهیمibrā`hīmʔeb.ɹɒː.ɦíːmʔeb.ɹɒː.ɦíːm
Passedامامi`māmʔe.mɒ́ːmʔe.mɒ́ːm
Failedپیشواpēš`vāpʰiːʃ.vɒ́ːpʰiːš.ʋɒ́ː5
Passedنوnawnownow
Failedمستعمرهmusta'ma`ramos.t̪ʰæʔ.mæ.ɹémos.t̪ʰæ'.mæ.ɹé9
Passedآزادā`zādʔɒː.zɒ́ːd̪̥ʔɒː.zɒ́ːd̪̥
Passedقولqawlqowl̥qowl̥
Passedدولتdawlatd̪ow.læt̪d̪ow.læt̪
Passedآخورāxwarʔɒː.xoɹʔɒː.xoɹ
Failedلغوlağwlæɢvlæɢʋ4
Passedگورgawrɡ̥owɹɡ̥owɹ
Failedمعتدلmu'tadilmoʔ.t̪ʰæ.d̪el̥mo'.t̪ʰæ.d̪el̥3
Passedخویxwayxojxoj
Passedخویدxwēdxiːd̪̥xiːd̪̥
Passedخودروxwadrawxod̪.ɹowxod̪.ɹow
Passedجوjawd͡ʒowd͡ʒow
Failedگوهرgaw`harɡ̥ow.hǽɹɡ̥ow.ɦǽɹ6
Failedغلوğuluw(w)qo.lov(v)qo.loʋ(ʋ)6
Passedپهلوpah`lawpʰæɦ.lówpʰæɦ.lów
Failedکتابki`tābkʰʲe.t̪ʰɒ́ːb̥ʃʰe.t̪ʰɒ́ːb̥1
Passedمگر`magarmǽ.ɡʲæɹmǽ.ɡʲæɹ
TermRespellingExpectedActualDiffers atComments
test_tajik:
Failedхуш (xuš)xwašχuʃχuš3
Passedхоб (xob)xwābχɔbχɔb
Failedабарнавахтар (abarnavaxtar)abarnawax`tarabaɾnavaχˈtaɾʔä.bäɾ.nä.ʋäχ.t̪ʰǽɾ1
FailedИброҳим (Ibrohim)ibrā`hīmibɾɔˈhimʔib.ɾɔ.ɦím1
Failedимом (imom)i`māmiˈmɔmʔi.mɔ́m1
Failedпешво (pešvo)pēš`vāpeʃˈvɔpʰeš.ʋɔ́2
Failedнав (nav)nawnavnäw2
Failedмустаъмара (mustaʾmara)musta'ma`ramustaʔmaˈɾamus.t̪ʰä'.mä.ɾǽ4
Failedфoтеҳ (foteh)fā`tihfɔˈteh.t̪ʰéʱ3
Failedдиҳад (dihad)di`haddiˈhadi.ɦǽd̪1
Failedфасеҳ (faseh)fa`sīhfaˈsehfä.séʱ2
Failedвасеъ (vaseʾ)va`sī'vaˈseʔʋä.sé'1
Failedохур (oxur)āxwarɔχuɾʔɔ.χuɾ1
Failedлағв (laġv)lağwlaʁvläğw2
Failedбиҳишт (bihišt)bihištbihiʃtbi.ɦišt̪3
Failedмӯътадил (müʾtadil)mu'tadilmɵʔtadil'.t̪ʰä.d̪il3
Passedхуй (xuy)xwayχujχuj
Failedхед (xed)xwēdχedχe3

local tests = require("Module:UnitTests")
local m_IPA = require("Module:User:OblivionKhorasan/pa-IPA-test")

local sc_fa = require("Module:scripts").getByCode("fa-Arab")
local sc_tg = require("Module:scripts").getByCode("Cyrl")
local lang_fa = require("Module:languages").getByCode("fa")
local lang_tg = require("Module:languages").getByCode("tg")

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

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

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

local options = { display = tag_IPA, show_difference = true }

function tests:check_output_fa(term, romanisation, expected)
	self:equals(
		{link(term), romanisation},
		m_IPA.fa_IPA(romanisation),
		expected,
		options
	)
end

function tests:check_output_fa_cls(term, romanisation, expected)
	self:equals(
		{link(term), romanisation},
		m_IPA.fa_cls_IPA(romanisation),
		expected,
		options
	)
end

function tests:check_output_tg(term, romanisation, expected)
	self:equals(
		{link_tg(term), romanisation},
		m_IPA.tg_IPA(romanisation),
		expected,
		options
	)
end

function tests:check_output_prs(term, romanisation, expected)
	self:equals(
		{link(term), romanisation},
		m_IPA.prs_IPA(romanisation),
		expected,
		options
	)
end

function tests:test_classical_persian()
	examples = {
		{ "خوش", "xwś", "xʊʃ"},
		{ "جھانجر", "`jHāṉjHar", "ˈd͡ʒʱãːn̠.d͡ʒəɾᵊ"},
		{ "ساوݨ", "`sāvaN", "ˈsaː.ʋəɳᵊ"},
		{ "مٹیار", "muTī`ār", "mʊ.ʈi.ˈjaːɾᵊ"},
		{ "لیا", "`leā", "ˈleː.aː"},
		{ "لیا", "le`ā", "le.ˈaː"},
		{ "کڑوا", "`kaRvā", "ˈkəɽᵊ.ʋaː"},
		{ "ملاوݨا", "milāvNā", "ˈmɪ.laːʋᵊ.ɳaː"},
	}
--[[	Copy the following to add more examples:
		{ "", "", ""},
]]
	
	tests:iterate(examples, "check_output_fa_cls")
end

function tests:test_dari_persian()
	examples = {
		{ "خوش", "xwaš", "xʊʃ"},
		{ "خواب", "xwāb", "xɑːb"},
		{ "ابرنواختر", "abar-naw-ax`tar", "ʔä.bäɾ.näw.ʔäx.t̪ʰǽɾ"},
		{ "ابراهیم", "ibrā`hīm", "ʔɪb.ɾɑː.ɦíːm"},
		{ "امام", "i`mām", "ʔɪ.mɑ́ːm"},
		{ "پیشوا", "pēš`vā", "pʰeːʃ.wɑ́ː"},
		{ "نو", "naw", "näw"},
		{ "مستعمره", "musta'ma`ra", "mʊs.t̪ʰäʔ.mä.ɾǽ"},
		{ "آزاد", "ā`zād", "ʔɑː.zɑ́ːd̪"},
		{ "قول", "qawl", "qäwl"},
		{ "دولت", "dawlat", "d̪äw.lät̪"},
		{ "آخور", "āxwar", "ʔɑː.xʊɾ"},
		{ "لغو", "lağw", "läɣw"},
		{ "گور", "gawr", "ɡäwɾ"},
		{ "معتدل", "mu'tadil", "mo̞ʔ.t̪ʰä.d̪ɪl"},
		{ "خوی", "xway", "xʊj"},
		{ "خوید", "xwēd", "xeːd̪"},
	}
--[[	Copy the following to add more examples:
		{ "", "", ""},
]]
	
	tests:iterate(examples, "check_output_prs")
end

function tests:test_iranian_persian()
	examples = {
		{ "خوش", "xwaš", "xoʃ"},
		{ "خواب", "xwāb", "xɒːb̥"},
		{ "ابرنواختر", "abar.naw.ax.`tar", "ʔæ.bæɹ.now.ʔæx.t̪ʰǽɹ"},
		{ "ابراهیم", "ibrā`hīm", "ʔeb.ɹɒː.ɦíːm"},
		{ "امام", "i`mām", "ʔe.mɒ́ːm"},
		{ "پیشوا", "pēš`vā", "pʰiːʃ.vɒ́ː"},
		{ "نو", "naw", "now"},
		{ "مستعمره", "musta'ma`ra", "mos.t̪ʰæʔ.mæ.ɹé"},
		{ "آزاد", "ā`zād", "ʔɒː.zɒ́ːd̪̥"},
		{ "قول", "qawl", "qowl̥"},
		{ "دولت", "dawlat", "d̪ow.læt̪"},
		{ "آخور", "āxwar", "ʔɒː.xoɹ"},
		{ "لغو", "lağw", "læɢv"},
		{ "گور", "gawr", "ɡ̥owɹ"},
		{ "معتدل", "mu'tadil", "moʔ.t̪ʰæ.d̪el̥"},
		{ "خوی", "xway", "xoj"},
		{ "خوید", "xwēd", "xiːd̪̥"},
		{ "خودرو", "xwadraw", "xod̪.ɹow"},
		{ "جو", "jaw", "d͡ʒow"},
		{ "گوهر", "gaw`har", "ɡ̥ow.hǽɹ"},
		{ "غلو", "ğuluw(w)", "qo.lov(v)"},
		{ "پهلو", "pah`law", "pʰæɦ.lów"},
		{ "کتاب", "ki`tāb", "kʰʲe.t̪ʰɒ́ːb̥"},
		{ "مگر", "`magar", "mǽ.ɡʲæɹ"},
	}
--[[	Copy the following to add more examples:
		{ "", "", ""},
]]
	
	tests:iterate(examples, "check_output_fa")
end

function tests:test_tajik()
	examples = {
		{ "хуш", "xwaš", "χuʃ"},
		{ "хоб", "xwāb", "χɔb"},
		{ "абарнавахтар", "abarnawax`tar", "abaɾnavaχˈtaɾ"},
		{ "Иброҳим", "ibrā`hīm", "ibɾɔˈhim"},
		{ "имом", "i`mām", "iˈmɔm"},
		{ "пешво", "pēš`vā", "peʃˈvɔ"},
		{ "нав", "naw", "nav"},
		{ "мустаъмара", "musta'ma`ra", "mustaʔmaˈɾa"},
        { "фoтеҳ", "fā`tih", "fɔˈteh"},
        { "диҳад", "di`had", "diˈhad"},
        { "фасеҳ", "fa`sīh", "faˈseh"},
        { "васеъ", "va`sī\'", "vaˈseʔ"},
		{ "охур", "āxwar", "ɔχuɾ"},
		{ "лағв", "lağw", "laʁv"},
		{ "биҳишт", "bihišt", "bihiʃt"},
		{ "мӯътадил", "mu'tadil", "mɵʔtadil"},
		{ "хуй", "xway", "χuj"},
		{ "хед", "xwēd", "χed"},
	}
--[[	Copy the following to add more examples:
		{ "", "", ""},
]]
	
	tests:iterate(examples, "check_output_tg")
end

return tests