Module:ga-mutation

local m_links = require("Module:links")

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

local export = {}

local function repl(forms, param) if param ~= "normal" and forms[param] == forms["normal"] then return "not applicable" end local ret = m_links.full_link({lang = lang, term = forms[param]}) if param == "len" and forms.an ~= forms.normal then ret = ret .. " ''after " .. m_links.full_link({lang = lang, alt = "an"}) .. ",'' " .. m_links.full_link({lang = lang, term = forms.an}) end return ret end

local table_cons = [=[

function export.mut_cons(frame) local params = { [1] = {required = true, default = ""}, [2] = {required = true, default = ""}, }	local args = require("Module:parameters").process(frame:getParent.args, params) local forms = require("Module:ga-common").mutations(args[1] .. args[2]) return (mw.ustring.gsub(table_cons, "", function(param) return repl(forms, param) end)) end

local table_vowel = [=[

function export.mut_vowel(frame) local params = { ["uc"] = {type = "boolean"}, }	local args = require("Module:parameters").process(frame:getParent.args, params) local forms = require("Module:ga-common").mutations(mw.title.getCurrentTitle.subpageText, "msn") return (mw.ustring.gsub(table_vowel, "", function(param) return repl(forms, param) end)) end

function export.mut(frame) local params = { [1] = {},		}	local args = require("Module:parameters").process(frame:getParent.args, params) local forms = require("Module:ga-common").mutations(mw.title.getCurrentTitle.subpageText, args[1]) local wikicode = mw.ustring.find(mw.ustring.lower(mw.title.getCurrentTitle.subpageText), "^[aeiouáéíóú]") and table_vowel or table_cons return (mw.ustring.gsub(wikicode, "", function(param) return repl(forms, param) end)) end

return export