Jump to content

Module:ne-IPA/testcases

From Wiktionary, the free dictionary

1 of 54 tests failed. (refresh)

TextExpectedActualComments
test_phonetic:
Passedविवाह (vivāha)[bibä̤ː][bibä̤ː]
Passedश्रावण (śrāwaṇ)[sräwʌɽ̃][sräwʌɽ̃]
Passedहलो (halo)[ɦʌlo][ɦʌlo]
Passedजहाज (jahāj)[d͡zä̤ː(d)z][d͡zä̤ː(d)z]
Passedकार्य (kārya)[kärːe][kärːe]
Passedपर्यो (paryo)[pʌɾjo][pʌɾjo]
Passedविश्व (viśwa)[bisːo][bisːo]
Passedअक्षर (akṣar)[ʌk̚t͡sʰer][ʌk̚t͡sʰer]
Passedक्षेत्री (kṣetrī)[t͡sʰet̪ri][t͡sʰet̪ri]
Passedत्यस (tyas)[t̪es][t̪es]
Passedविश्व (viśwa)[bisːo][bisːo]
Passedराज्य (rājya)[räd̚d͡ze][räd̚d͡ze]
Passedअङ्ग्रेजी (aṅgrejī)[ʌŋɡre(d)zi][ʌŋɡre(d)zi]
Passedपेय (peya)[pe(j)ʌ][pe(j)ʌ]
Passedअन्तर्राष्ट्रिय (antarrāṣṭriya)[ʌn̪t̪ʌrːäs̠t̠rie][ʌn̪t̪ʌrːäs̠t̠rie]dental assimilation
Passedसय (saya)[sʌe][sʌe]non-initial ya before before consonants
Passedसत्य (satya)[sʌt̪t̪e][sʌt̪t̪e]gemination of preceding consonant and replacement with e
Passedयस (yas)[es][es]Initial ya replacement with e
Passedविश्वास (viśvās)[biswäs][biswäs]w to b before certain vowels and glides
Passedविश्व (viśwa)[bisːo][bisːo]
Passedवरिपरि (waripari)[wʌɾipʌɾi][wʌɾipʌɾi]w elsewhere
Passedघरको (gharko)[ɡʱʌ̤rko][ɡʱʌ̤rko]breathy vowel after voiced aspirates
Passedअर्थ (artha)[ʌrt̪ʰʌ][ʌrt̪ʰʌ]
Passedअर्को (arko)[ʌrko][ʌrko]
Passedतारा (tārā)[t̪äɾä][t̪äɾä]tapped r intervocalically
Passedघोडा (ghoḍā)[ɡʱo̤ɽä][ɡʱo̤ɽä]retroflex tap postvocalically
Passedडर (ḍar)[ɖʌr][ɖʌr]ḍ elsewhere
Passedकस्को (kasko)[kʌsko][kʌsko]
Passedकसको (kasko)[kʌsko][kʌsko]
Passedलर्क (larka)[lʌrkʌ][lʌrkʌ]turned v into schwa final syllable
Passedसम्म (samma)[sʌmːʌ][sʌmːʌ]
Passedसंस्था (sansthā)[sʌnst̪ʰä][sʌnst̪ʰä]
Passedरुची (rucī)[rut͡si][rut͡si]
Passedहाम्रो (hāmro)[ɦämro][ɦämro]
Passedबाह्र (bāhra)[bäɾʌ][bäɾʌ]
Passedबाह्रखरी (bāhrakharī)[bäɾʌk̞ʰʌɾi][bäɾʌk̞ʰʌɾi]
Passedबाह्य (bāhya)[bäi̯e][bäi̯e]
Passedचर्चा (carcā)[t͡sʌrt͡sä][t͡sʌrt͡sä]
Passedरचना (racanā)[rʌt͡sʌnä][rʌt͡sʌnä]
Passedटर्रो (ṭarro)[ʈʌrːo][ʈʌrːo]
Passedआर (ār)[är][är]
Passedईर् (īr)[ir][ir]
Passedरातो (rāto)[rät̪o][rät̪o]
Failedउर (ura)[ur][uɾʌ]
Passedदुई (duī)[d̪ui̯][d̪ui̯]
Passedचप्पल (cappal)[t͡sʌp̚pʌl][t͡sʌp̚pʌl]
Passedपक्का (pakkā)[pʌk̚kä][pʌk̚kä]
Passedअस्ट्रेलिया (asṭreliyā)[ʌs̠t̠relijä][ʌs̠t̠relijä]
Passedभिज़न (bhizan)[bʱi̤zʌn][bʱi̤zʌn]
Passedऑस्ट्रेलिया (ŏsṭreliyā)[ɒs̠t̠relijä][ɒs̠t̠relijä]
Passedॲप (ĕp)[æp][æp]
Passedज़ू ()[zu][zu]
Passedद़िस (ðis)[ðis][ðis]
Passedथ़िक (θik)[θik][θik]

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ä"},
        {"ॲप", "æp"},
        {"ज़ू", "zu"},
        {"द़िस", "ðis"},
        {"थ़िक", "θik"}
    }
    tests:iterate(examples, "check_output")
end

return tests