Module:User:Malku H₂n̥rés/lang-IPA

local export = {}

local m_IPA = require("Module:IPA") local lang = require("Module:languages").getByCode("lang") local s = mw.ustring.gsub local C = "[consonants]" local V = "[vowels]" local c = { {"", ""}, 	{"", ""} } local dialect1 = { {"", ""},	{"", ""} }

function export.pronunciation_phonemic(word) word = mw.ustring.lower(word) for a = 1, #c do		word = s(word, c[a][1], c[a][2]) end return word end

function export.pronunciation_phonetic(word, dialect) if dialect == "dialect1" then for a = 1, #dialect1 do			word = s(word, dialect1[a][1], dialect1[a][2]) end end return word end

function export.show(frame) local args = frame:getParent.args local p, results, results_lang = {}, {}, {} if not args[1] or (args[1] == "") then error("Please put the word as the first positional parameter!") else for index, item in ipairs(args) do			table.insert(p, (item ~= "") and item or nil) end end for _, word in ipairs(p) do		word = export.pronunciation_phonemic(word) table.insert(results, {pron = "/" .. word .. "/"}) table.insert(results_lang, {pron = "[" .. export.pronunciation_phonetic(word, "dialect1") .. "]"}) end return "* " .. m_IPA.format_IPA_full { lang = lang, items = results } .. "\n** " .. m_IPA.format_IPA_full { lang = lang, items = results_lang } --[=[	local results = {} table.insert(results, {pron = "/" .. export.pronunciation_phonemic(mw.title.getCurrentTitle.text) .. "/"}) return "* " .. require("Module:IPA").format_IPA_full { lang = require("Module:languages").getByCode("akk"), items = results } --]=] end

return export