Module:fa-ira-translit/testcases
Appearance
- The following documentation is located at Module:fa-ira-translit/testcases/documentation. [edit] Categories were auto-generated by Module:module categorization. [edit]
- Useful links: root page • root page’s subpages • links • transclusions • tested module • sandbox
This is the unit testing module for Module:fa-ira-translit.
3 of 38 tests failed. (refresh)
Text | Expected | Actual | Differs at | |
---|---|---|---|---|
سَرْاَنْجام | sar-anjâm | sar-anjâm | ||
کُروز | koruz | koruz | ||
کُرُوز | korowz | korowz | ||
واو | vâv | vâv | ||
نُوروز | nowruz | nowruz | ||
قَهْوِهای | ğahve-i | ğahve-i | ||
خوانْدَن | xândan | xândan | ||
خویش | xiš | xiš | ||
خوَد | xod | xod | ||
چامِهسَرایی | čâme-sarâyi | čâme-sarâyi | ||
چامهسَرایی | (nil) | (nil) | N/A | |
طَنین | tanin | tanin | ||
طَنِین | taneyn | taneyn | ||
لِهٰذا | lehâzâ | lehâzâ | ||
عَصاً | asan | asan | ||
خانه | (nil) | (nil) | N/A | |
خانِه | xâne | xâne | ||
کُرِهٔ شُمالی | kore-ye šomâli | kore-ye šomâli | ||
ضَمّه | (nil) | (nil) | N/A | |
ضَمِّه | zamme | zamme | ||
وُدْکا | vodkâ | vodkâ | ||
اَرْمَنِسْتان | armanestân | armanestân | ||
باکو | bâku | bâku | ||
بَرادَرِ بُزُرْگ | barâdar-e bozorg | barâdar-e bozorg | ||
قُرونِ وُسْطیٰ | ğorun-e vostâ | ğorun-e vostâ | ||
دَرْ-آمَد | dar-âmad | dar-âmad | ||
بازیِ شَطْرَنْج | bâzi-ye šatranj | bâzi-ye šatranj | ||
متعلق | (nil) | (nil) | N/A | |
مُتَعَلِّق | mota'alleğ | mota'alleğ | ||
اِتِّحادِیِهٔ اُروپا | ettehâdiye-ye orupâ | ettehâdiye-ye orupâ | ||
آیَتُاللّٰه | âyato-llâh | âyato-l-lâh | 8 | |
شِیْخ | šeyx | šeyx | ||
نُوْروز | nowruz | nowruz | ||
پَیام | payâm | peyâm | 2 | |
اَیّوب | ayyub | eyّub | 1 | |
شِبْهِجَزیرِه | šebh-e-jazire | šebh-e-jazire | ||
پایْگاهِدادِه | pâygâh-e-dâde | pâygâh-e-dâde | ||
صَحْرایِ غَرْبی | sahrâ-ye ğarbi | sahrâ-ye ğarbi |
-- Unit tests for [[Module:fa-translit]]. Refresh page to run tests.
local tests = require('Module:UnitTests')
local fa_translit = require('Module:fa-ira-translit')
local m_links = require('Module:links')
local fa = require('Module:languages').getByCode('fa')
local function link(term)
return m_links.full_link{term = term, lang = fa}
end
function tests:do_test_translit(Pers, roman, xlit)
self:equals(link(Pers), fa_translit.tr(Pers, 'fa', 'fa-Arab'), roman)
end
function tests:test_translit_persian()
local examples = {
{ 'سَرْاَنْجام', "sar-anjâm" },
{ 'کُروز', "koruz" },
{ 'کُرُوز', "korowz" }, -- this word is intentionally incorrect but demonstrates that zamme before vaaw produces a diphthong
{ 'واو', "vâv" },
{'نُوروز', "nowruz"},
{ 'قَهْوِهای'
, "ğahve-i" }, -- case for های as e-yi
{'خوانْدَن', "xândan"}, -- case for خوا as xâ
{'خویش', "xiš"}, -- case for خوی as xi
{'خوَد', "xod"}, -- case for خو as xo (Iranian Persian) and xwad (Classical Persian)
{ 'چامِهسَرایی',
"čâme-sarâyi" },
{ 'چامهسَرایی',
nil },
{ 'طَنین', "tanin" },
{ 'طَنِین', "taneyn" }, -- this word is intentionally incorrect but demonstrates that kasre before ye produces a diphthong
{ 'لِهٰذا', "lehâzâ" },
{ 'عَصاً', "asan" },
{ 'خانه', nil },
{ 'خانِه', "xâne" },
{ 'کُرِهٔ شُمالی', "kore-ye šomâli" },
{ 'ضَمّه', nil },
{ 'ضَمِّه', "zamme" },
{ 'وُدْکا', "vodkâ" },
{ 'اَرْمَنِسْتان', "armanestân" },
{ 'باکو', "bâku" },
{"بَرادَرِ بُزُرْگ", "barâdar-e bozorg"}, -- ezafe, need a hyphen
{'قُرونِ وُسْطیٰ', "ğorun-e vostâ" }, -- a dagger alif case
{'دَرْ-آمَد', "dar-âmad" }, -- alif madda test
{ 'بازیِ شَطْرَنْج', "bâzi-ye šatranj" }, -- unmarked ezâfe with a kasra
{'متعلق', nil}, -- should fail without vocalisations
{'مُتَعَلِّق', "mota'alleğ"},
{'اِتِّحادِیِهٔ اُروپا', "ettehâdiye-ye orupâ"},
{ "آیَتُاللّٰه", "âyato-llâh"},
{ 'شِیْخ', "šeyx"}, -- kasra + ye + consonant should give "ey"
{'نُوْروز', "nowruz"}, -- 'ow' , not 'ov'? Is this right?
{'پَیام', "payâm"},
{'اَیّوب', "ayyub"},
{'شِبْهِجَزیرِه', "šebh-e-jazire"}, -- ZWNJ should produce a hyphen
{'پایْگاهِدادِه',"pâygâh-e-dâde"}, --ZWNJ should produce a hyphen
{'صَحْرایِ غَرْبی', "sahrâ-ye ğarbi"},
}
self:iterate(examples, "do_test_translit")
end
return tests