Module:User:George Animal/ipa/ku

local m_utilities = require("Module:utilities") local m_links = require("Module:links")

local export = {}

local lang = require("Module:languages").getByCode("ku")

local function postprocess(args, data) -- Nothing here yet end

-- Inflection functions

export["them"] = function(frame) local params = { [1] = {required = true, default = ""}, }	local args = require("Module:parameters").process(frame:getParent.args, params) local data = {forms = {}, info = "thematic", categories = {lang:getCanonicalName .. " thematic verbs"}} -- Present indicative data.forms["actv_pres_indc_1sg"] = {args[1] .. "înim"} data.forms["actv_pres_indc_2sg"] = {args[1] .. "înî"} data.forms["actv_pres_indc_3sg"] = {args[1] .. "îne"} data.forms["actv_pres_indc_1pl"] = {args[1] .. "înin"} data.forms["actv_pres_indc_2pl"] = {args[1] .. "înin"} data.forms["actv_pres_indc_3pl"] = {args[1] .. "înin"} -- Imperative data.forms["actv_impr_2sg"] = {args[1] .. "d"} data.forms["actv_impr_2pl"] = {args[1] .. "înin"} postprocess(args, data) return make_table(data) .. m_utilities.format_categories(data.categories, lang) end

local names = { ["actv"] = "Active voice", ["pres_indc"] = "Present indicative", ["impr"] = "Imperative", ["1sg"] = "1st singular", ["2sg"] = "2nd singular", ["3sg"] = "3rd singular", ["1pl"] = "1st plural", ["2pl"] = "2nd plural", ["3pl"] = "3rd plural", }

-- Make the table function make_table(data) local function repl(param) if param == "info" then return mw.getContentLanguage:ucfirst(data.info or "") end local form = data.forms[param] if not form or #form == 0 then return "&mdash;" end local ret = {} for key, subform in ipairs(form) do table.insert(ret, m_links.full_link(nil, "*" .. subform, lang, nil, nil, nil, {}, false)) end return table.concat(ret, ", ") end local pns = {"1sg", "2sg", "3sg", "1pl", "2pl", "3pl"} local voices = {"actv", "pasv"} local moods = {"pres_indc", "pres_subj", "impr"} local wikicode = {} table.insert(wikicode, "{| class=\"inflection-table vsSwitcher\" data-toggle-category=\"inflection\" style=\"background: #FAFAFA; border: 1px solid #d0d0d0; text-align: left;\" cellspacing=\"1\" cellpadding=\"2\"") table.insert(wikicode, "|- style=\"background: #CCCCFF;\"\n! class=\"vsToggleElement\" colspan=\"" .. (#moods + 1) .. "\" | ") for _, voice in ipairs(voices) do table.insert(wikicode, "|- class=\"vsHide\" style=\"background: #CCCCFF;\"\n! " .. names[voice]) for _, mood in ipairs(moods) do table.insert(wikicode, "! style=\"min-width: 11em; background: #CCCCFF;\" | " .. names[mood]) end for _, pn in ipairs(pns) do table.insert(wikicode, "|- class=\"vsHide\" style=\"background-color: #F2F2FF;\"\n! style=\"min-width: 8em; background-color: #E6E6FF;\" | " .. names[pn]) for _, mood in ipairs(moods) do				table.insert(wikicode, "| ") end end end table.insert(wikicode, "|}") wikicode = table.concat(wikicode, "\n") return (mw.ustring.gsub(wikicode, "", repl)) end

return export