Module:ml-IPA/testcases

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

local function tag_IPA(IPA) return ' ' .. IPA .. ' ' end

function tests:check_output(term, expected, comment) self:equals(		m_IPA.link(term),		tag_IPA(m_IPA.to_IPA(term)[1]),		tag_IPA(expected),		{ comment = comment }	) end

function tests:test_all examples = { { "അമ്മ", "ɐm.mɐ"}, { "അച്ഛൻ", "ɐt͡ʃ.t͡ʃ(ʰ)ɐn"}, { "മീൻ", "miːn"}, { "ഉത്സവം", "ut̪.sɐ.ʋɐm, ul.sɐ.ʋɐm", "in /{t̪, d̪}{k, g, p, b, m, s}/, the /t̪, d̪/ may also be pronounced as [l]"}, { "പാഠം", "paː.ʈʰɐm, paː.ɖ(ʱ)ɐm", "aspiration is not universal, medial voiceless aspirated may even be voiced"}, { "ശുണ്ഠി", "ʃuɳ.ʈʰi, ʃuɳ.ɖ(ʱ)i", "voiceless aspirates after a nasal"}, { "ദുഃഖം", "d̪uk.k(ʰ)ɐm", "visarga gemination"}, { "ശ്രദ്ധ", "ʃrɐd̪.d̪(ʱ)ɐ, srɐd̪.d̪(ʱ)ɐ", "/ʃ{r, l}/ is sometimes pronounced with [s] especially for the former"}, { "മുഹറ്രം", "mu.har.rɐm", "currently  is made /tt/ but it turns  (actual way of representing /rr/) too to /tt/"}, { "പംക്തി", "pɐŋk.t̪i"}, { "കടുംകൈ", "kɐ.ɖuŋ.ɡɐi̯", "voicing from anusvara"}, { "റ്റന്റൻ്ററ്റ", "tɐn.tɐn.tɐt.tɐ", "no initial geminates, and both common ways of typing nr though the latter is wrong,"}, { "അൻവൻ", "ɐn.ʋɐn"}, { "ഊർജ്ജം", "uːr(d͡ʒ).d͡ʒɐm", "rCC is not always doubled"}, { "എആംൻപംൽ", "e.aːnn.bɐml", "anusvara + chillu"}, { "അംലംന", "ɐm.lɐn.nɐ", "anusvara + consonant"}, { "നൃൽ", "n̪ril", "currently /n̪r/ is made /nd/ to display ന്റ, ൻ്റ  /nd/ but it turns നൃ  too to /ndi/."}, { "നൗൽ", "n̪ɐu̯l"}, { "ഉ്തു്തൂ്തു്", "ə̆.d̪ə̆.d̪əː.d̪ə̆"}, { "അഁത഻തൌ", "ɐ̃t̪.t̪ɐu̯"}, { "അഀത഼തൗ", "ɐn̪t̪.t̪ɐu̯"}, { "അഁത഻", "ɐ̃t̪"}, { "ഔത഼", "ɐu̯t̪"}, { "പത്ത് അടി", "pɐt̪.t̪‿ɐ.ɖi", "ŭ elided before vowels"}, } --	Copy the following to add more examples:		{ "", "" }, tests:iterate(examples, "check_output") end

return tests