Module:ga-mutation

Hello, you have come here looking for the meaning of the word Module:ga-mutation. In DICTIOUS you will not only get to know all the dictionary meanings for the word Module:ga-mutation, but we will also tell you about its etymology, its characteristics and you will know how to say Module:ga-mutation in singular and plural. Everything you need to know about the word Module:ga-mutation you have here. The definition of the word Module:ga-mutation will help you to be more precise and correct when speaking or writing your texts. Knowing the definition ofModule:ga-mutation, as well as those of other words, enriches your vocabulary and provides you with more and better linguistic resources.

This module needs documentation.
Please document this module by describing its purpose and usage on the documentation page.

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 == forms then
		return "''not applicable''"
	end
	
	local ret = m_links.full_link({lang = lang, term = forms})
	
	if param == "len" and forms.an ~= forms.normal then
		ret = ret .. "<br/>''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 = [=[
{| border="1" cellpadding="4" cellspacing="0" class="inflection-table" style="align: left; margin: 0.5em 0 0 0; border-style: solid; border: 1px solid #7f7f7f; border-right-width: 2px; border-bottom-width: 2px; border-collapse: collapse; background-color: #F8F8F8; font-size: 95%;"
|-
! colspan="3" | ]
|-
! Radical
! Lenition
! Eclipsis
|-
| {{{normal}}}
| {{{len}}}
| {{{ecl}}}
|-
| colspan="3" | <small style="font-size:85%;">''Note:'' Some of these forms may be hypothetical. Not every possible mutated form of every word actually occurs.</small>
|}]=]


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


local table_vowel = [=[
{| border="1" cellpadding="4" cellspacing="0" class="inflection-table" style="align: left; margin: 0.5em 0 0 0; border-style: solid; border: 1px solid #7f7f7f; border-right-width: 2px; border-bottom-width: 2px; border-collapse: collapse; background-color: #F8F8F8; font-size: 95%;"
|-
! colspan="4" | ]
|-
! Radical !! Eclipsis !! with ''h''-prothesis !! with ''t''-prothesis
|-
| {{{normal}}}
| {{{ecl}}}
| {{{hpro}}}
| {{{tpro}}}
|-
| colspan="4" | <small style="font-size:85%;">''Note:'' Some of these forms may be hypothetical. Not every possible mutated form of every word actually occurs.</small>
|}]=]


function export.mut_vowel(frame)
	local params = {
		 = {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 = {
		 = {},
		}
	
	local args = require("Module:parameters").process(frame:getParent().args, params)
	
	local forms = require("Module:ga-common").mutations(mw.title.getCurrentTitle().subpageText, args)
	local wikicode = mw.ustring.find(mw.ustring.lower(mw.title.getCurrentTitle().subpageText), "^") and table_vowel or table_cons
	
	return (mw.ustring.gsub(wikicode, "{{{(+)}}}", function(param) return repl(forms, param) end))
end

return export