Module:ne-IPA/testcases
La documentation pour ce module peut être créée à Module: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" },
{ "जहाज", "d͡zä̤ː(d)z" },
{ "कार्य", "kärːe" },
{ "पर्यो", "pʌɾjo" },
{ "विश्व", "bisːo" },
{ "अक्षर", "ʌk̚t͡sʰer" },
{ "क्षेत्री", "t͡sʰet̪ri" },
{ "त्यस", "t̪es" },
{ "विश्व", "bisːo" },
{ "राज्य", "räd̚d͡ze" },
{ "अङ्ग्रेजी", "ʌŋɡre(d)zi" },
{ "पेय", "pe(j)ʌ" },
{ "अन्तर्राष्ट्रिय", "ʌ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ʌ", "turned v into schwa final syllable" },
{ "सम्म", "sʌmːʌ"},
{ "संस्था", "sʌnst̪ʰä" },
{ "रुची", "rut͡si"},
{ "हाम्रो", "ɦämro" },
{ "बाह्र", "bäɾʌ" },
{ "बाह्रखरी", "bäɾʌk̞ʰʌɾi" },
{ "बाह्य", "bäi̯e" },
{ "चर्चा", "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ä"},
{ "भिज़न", "bʱi̤zʌn" },
{ "ऑस्ट्रेलिया", "ɒs̠t̠relijä", "not pronounced this way in Nepali" },
{ "ॲप", "æp"},
{ "ज़ू", "zu"},
{ "द़िस", "ðis" },
{ "थ़िक", "θik" },
}
tests:iterate(examples, "check_output")
end
return tests