Module:gmq-jmk-cell

local m_links = require("Module:links") local lang = require("Module:languages").getByCode("gmq-jmk") local export = {}

local accel_forms = { --NOUNS nasi = "indef|nom|-|acc|s", nasd = "def|nom|-|acc|s", napi = "indef|nom|-|acc|p", napd = "def|nom|-|acc|p", dsi = "indef|dat|s", dsd = "def|dat|s", dpi = "indef|dat|p", dpd = "def|dat|p", gsi = "indef|gen|s", gsd = "def|gen|s", gpi = "indef|gen|p", gpd = "def|gen|p", vsi = "indef|voc|s", vsd = "def|voc|s", vpi = "indef|voc|p", vpd = "def|voc|p", --ADJECTIVES nsm = "m|nom|s", --strong nom. sg. nsf = "f|nom|s", nsn = "n|nom|s", asm = "m|acc|s", --strong acc. sg. asf = "f|acc|s", asn = "n|acc|s", gsm = "m|gen|s", --strong gen. sg. gsf = "f|gen|s", gsn = "n|gen|s", dsm = "m|dat|s", --strong dat. sg. dsf = "f|dat|s", dsn = "n|dat|s", npm = "m|nom|p", --strong nom. pl.	npf = "f|nom|p", npn = "n|nom|p", apm = "m|acc|p", --strong acc. pl.	apf = "f|acc|p", apn = "n|acc|p", gp = "m//f//n|gen|p", --strong gen. pl.	dp  = "m//f//n|dat|p", --VERBS pres_part = "pres|part", past_part = "past|part", pres_ind = "pres|ind", past_ind = "past|ind",

pres_sub = "pres|sub", past_sub = "past|sub",

impr_2sg = "imp|2|sg", impr_1pl = "imp|1|pl", impr_2pl = "imp|2|pl" }

local mode_prefix = { --this is prefixed to the index value in accel_forms mpass = "mp_" }

local mode_prepend = { --on the other hand, this is prefixed to the accelerated text itself wk     = "weak|", str    = "strong|", comp   = "comparative|", wk_sup = "weak|superlative|", str_sup = "strong|superlative|" }

function export.create(frame) local args = frame:getParent.args local links = {} if not args[1] or args[1] == "" then return "―" else local accel_form = args[2] local accel if accel_form then local mode = args[3] if mode and mode_prefix[mode] then accel_form = mode_prefix[mode] .. accel_form end if accel_forms[accel_form] then if mode and mode_prepend[mode] then accel_form = mode_prepend[mode] .. accel_forms[accel_form] else accel_form = accel_forms[accel_form] end end accel = {form = accel_form} end local words = mw.text.split(args[1], "%s*,%s*") if words then for i,j in ipairs(words) do				table.insert(links, m_links.full_link({lang = lang, term = j, accel = accel})) end end end return table.concat(links, ", ") end

return export