မဝ်ဂျူ:ne-IPA/testcases
Documentation for this module may be created at မဝ်ဂျူ:ne-IPA/testcases/doc
local tests = require("Module:UnitTests")
local m_IPA = require("Module:ne-IPA")
local function tag_IPA(IPA)
if phonetic then
IPA = '/' .. IPA .. '/'
else
IPA = '[' .. IPA .. ']'
end
return '<span class="IPA">' .. IPA .. '</span>'
end
function tests:check_output(term, expected, comment)
self:equals(
m_IPA.link(term),
tag_IPA(m_IPA.toIPA(term, "standard")),
tag_IPA(expected),
{ comment = comment }
)
end
function tests:test_phonetic()
examples = {
{ "विवाह", "bibäɦä̆" },
{"श्रावण", "sräwʌɽ̃"},
{ "हलो", "ɦʌlo" },
{ "अक्षर", "ʌk̚t͡sʰer" },
{ "क्षेत्री", "t͡sʰet̪ri" },
{ "त्यस", "t̪es" },
{ "विश्व", "bisːo" },
{ "पेय", "pejʌ" },
{ "अन्तर्राष्ट्रिय", "ʌ̃n̪t̪ʌrːäs̠t̠rie̞", "dental assimilation" },
{ "सय", "sʌe̞", "non-initial ya before before consonants" },
{ "सत्य", "sʌt̪t̪e", "gemination of preceding consonant and replacement with e" },
{"यस", "es", "Initial ya replacement with e" },
{ "विश्वास", "biswäs", "w to b before certain vowels and glides" },
{ "विश्व", "bisːo"},
{ "वरिपरि", "wʌɾipʌɾi", "w elsewhere" },
{ "घरको", "ɡʱʌ̤rko", "breathy vowel after voiced aspirates" },
{ "अर्थ", "ʌrt̪ʰʌ"},
{ "अर्को", "ʌrko"},
{ "तारा", "t̪äɾä", "tapped r intervocalically" },
{ "घोडा", "ɡʱo̤ɽä", "retroflex tap postvocalically" },
{ "डर", "ɖʌr", "ḍ elsewhere" },
{ "कस्को", "kʌsko" },
{ "कसको", "kʌsko"},
{ "लर्क", "lʌrkʌ"},
{ "सम्म", "sʌ̃mːʌ"},
{ "संस्था", "sʌ̃nst̪ʰä" },
{ "रुची", "rut͡si"},
{ "आहा", "äɦä" },
{ "हाम्रो", "ɦä̃mro" },
{ "बाह्र", "bäɾʌ" },
{ "बाह्रखरी", "bäɾʌk̞ʰʌɾi" },
{ "चर्चा", "t͡sʌrt͡sä"},
{ "रचना", "rʌt͡sʌ̃nä"},
{ "टर्रो", "ʈʌrːo"},
{ "आर", "är"},
{ "ईर्", "ir"},
{ "रातो", "rät̪o"},
{ "उर", "ur"},
{ "दुई", "d̪ui̯"},
{ "चप्पल", "t͡sʌp̚pʌl"},
{ "पक्का", "pʌk̚kä"},
{ "ऑस्ट्रेलिया", "ɒs̠t̠relijä"},
{ "टेलिव़िश़न", "ʈeliviʒʌ̃n" },
{ "व़िझ़न", "viʒʌ̃n" },
{ "ॲप", "æp"},
{ "ज़ू", "zu"},
{ "द़िस", "ðis" },
{ "थ़िक", "θik" },
}
tests:iterate(examples, "check_output")
end
return tests