Module:IPA letters

local export = {}

function export.get_IPA_pronunciation(lang, items) local ok, pronunciation_data = pcall(require, "Module:IPA letters/" .. lang:getCode) if not ok then error("There isn't a data module for " .. lang:getCanonicalName			.. ". Please create Module:IPA letters/" .. lang:getCode .. ".") end local output = require("Module:array") for i, item in ipairs(items) do		local stress, letter_or_number = item:match("^('?)(.+)$") if i > 1 then output:insert " " end if stress == "'" then output:insert "ˈ" end letter_or_number = mw.ustring.upper(letter_or_number) output:insert(pronunciation_data[letter_or_number] or "") end return output:concat end

function export.show_IPA_pronunciation(lang, items) return require("Module:IPA").format_IPA_full { lang = lang, items = , } end

function export.show(frame) local args = frame:getParent.args local title = mw.title.getCurrentTitle if title.nsText == "Template" and not (args.lang and args[1]) then args = { lang = "en", "a", "b", "c" } end lang = args.lang or error("The parameter 'lang' is required.") local m_languages = require("Module:languages") lang = lang and m_languages.getByCode(lang) or m_languages.err(lang, "lang") if not (args[1] and args[1] ~= "") then error("Parameter 1 is required.") end return export.show_IPA_pronunciation(lang, args) end

return export