Jump to content

Module:fa-IPA/testcases

From Wiktionary, the free dictionary

26 of 76 tests failed. (refresh)

TermRespellingExpectedActualDiffers atComments
test_classical_persian:
Passedخوشxwašxʷaʃxʷaʃ
Failedخوابxwābxʷɑːbxʷɑːβ5
Failedابرنواخترabar-naw-ax`tarabaɾnawaxˈtaɾʔa.βaɾ.naw.ʔax.ˈtaɾ1
Failedابراهیمibrā`hīmibɾɑːˈhiːmʔiβ.ɾɑː.ˈhiːm1
Failedامامi`māmiˈmɑːmʔi.ˈmɑːm1
Failedپیشواpēš`vāpeːʃˈwɑːpeːʃ.ˈwɑː5
Passedنوnawnawnaw
Failedمستعمرهmusta'ma`ramustaʔmaˈɾamus.taʔ.ma.ˈɾa4
Failedآزادā`zādɑːˈzɑːðʔɑː.ˈzɑːð1
Failedدادنdā`dandɑːˈðandɑː.ˈðan4
Passedقولqawlqawlqawl
Failedدولتdawlatdawlatdaw.lat4
Failedآخورāxwarɑːxʷaɾʔɑː.xʷaɾ1
Passedلغوlağwlaɣwlaɣw
Failedمعتدلmu'tadilmuʔtaðilmuʔ.ta.ðil4
Passedخویxwayxʷajxʷaj
Passedخویدxwēdxʷeːðxʷeːð
TermRespellingExpectedActualDiffers atComments
test_dari_persian:
Passedخوشxwašxʊʃxʊʃ
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
Passedپیشواpēš`vāpʰeːʃ.wɑ́ːpʰeːʃ.wɑ́ː
Passedنوnawnäwnäw
Passedمستعمرهmusta'ma`ramʊs.t̪ʰäʔ.mä.ɾǽmʊs.t̪ʰäʔ.mä.ɾǽ
Passedآزادā`zādʔɑː.zɑ́ːd̪ʔɑː.zɑ́ːd̪
Passedقولqawlqäwlqäwl
Passedدولتdawlatd̪äw.lät̪d̪äw.lät̪
Passedآخورāxwarʔɑː.xʊɾʔɑː.xʊɾ
Passedلغوlağwläɣwläɣw
Passedگورgawrɡäwɾɡäwɾ
Passedمعتدلmu'tadilmo̞ʔ.t̪ʰä.d̪ɪlmo̞ʔ.t̪ʰä.d̪ɪl
Passedخویxwayxʊjxʊj
Passedخویدxwēdxeːd̪xeːd̪
TermRespellingExpectedActualDiffers atComments
test_iranian_persian:
Passedخوشxwašxoʃxoʃ
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
Passedپیشواpēš`vāpʰiːʃ.vɒ́ːpʰiːʃ.vɒ́ː
Passedنوnawnownow
Passedمستعمرهmusta'ma`ramos.t̪ʰæʔ.mæ.ɹémos.t̪ʰæʔ.mæ.ɹé
Passedآزادā`zādʔɒː.zɒ́ːd̪̥ʔɒː.zɒ́ːd̪̥
Passedقولqawlqowl̥qowl̥
Passedدولتdawlatd̪ow.læt̪d̪ow.læt̪
Passedآخورāxwarʔɒː.xoɹʔɒː.xoɹ
Passedلغوlağwlæɢvlæɢv
Passedگورgawrɡ̥owɹɡ̥owɹ
Passedمعتدلmu'tadilmoʔ.t̪ʰæ.d̪el̥moʔ.t̪ʰæ.d̪el̥
Passedخویxwayxojxoj
Passedخویدxwēdxiːd̪̥xiːd̪̥
Passedخودروxwadrawxod̪.ɹowxod̪.ɹow
Passedجوjawd͡ʒowd͡ʒow
Passedگوهرgaw`harɡ̥ow.hǽɹɡ̥ow.hǽɹ
Passedغلوğuluw(w)qo.lov(v)qo.lov(v)
Passedپهلوpah`lawpʰæɦ.lówpʰæɦ.lów
Passedکتابki`tābkʰʲe.t̪ʰɒ́ːb̥kʰʲe.t̪ʰɒ́ːb̥
Passedمگر`magarmǽ.ɡʲæɹmǽ.ɡʲæɹ
TermRespellingExpectedActualDiffers atComments
test_tajik:
Passedхуш (xuš)xwašχuʃχuʃ
Passedхоб (xob)xwābχɔbχɔb
Failedабарнавахтар (abarnavaxtar)abarnawax`tarabaɾnavaχˈtaɾʔä.bäɾ.nä.väχ.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ʃ.vɔ́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ʔvä.séʔ2
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ɵʔtadilmɵʔ.t̪ʰä.d̪il4
Passedхуй (xuy)xwayχujχuj
Failedхед (xed)xwēdχedχe3

local tests = require("Module:UnitTests")
local m_IPA = require("Module:fa-IPA")

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 = {
		{ "خوش", "xwaš", "xʷaʃ"},
		{ "خواب", "xwāb", "xʷɑːb"},
		{ "ابرنواختر", "abar-naw-ax`tar", "abaɾnawaxˈtaɾ"},
		{ "ابراهیم", "ibrā`hīm", "ibɾɑːˈhiːm"},
		{ "امام", "i`mām", "iˈmɑːm"},
		{ "پیشوا", "pēš`vā", "peːʃˈwɑː"},
		{ "نو", "naw", "naw"},
		{ "مستعمره", "musta'ma`ra", "mustaʔmaˈɾa"},
		{ "آزاد", "ā`zād", "ɑːˈzɑːð"},
		{ "دادن", "dā`dan", "dɑːˈðan"},
		{ "قول", "qawl", "qawl"},
		{ "دولت", "dawlat", "dawlat"},
		{ "آخور", "āxwar", "ɑːxʷaɾ"},
		{ "لغو", "lağw", "laɣw"},
		{ "معتدل", "mu'tadil", "muʔtaðil"},
		{ "خوی", "xway", "xʷaj"},
		{ "خوید", "xwēd", "xʷeːð"},
	}
--[[	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