Module:siwa-noun: Difference between revisions

No edit summary
No edit summary
Line 14: Line 14:


local PAGENAME = mw.title.getCurrentTitle().text
local PAGENAME = mw.title.getCurrentTitle().text
local vowels = "[aeiouyůõảẻỉỏủỷę̊]"
--[[local vowels = "[aeiouyůõảẻỉỏủỷę̊]"
local consonants = "[mpbvntdsṡʦʨʥŋɲcɟħðrṁṅḥkgġhłƛɬḍ]"
local consonants = "[mpbvntdsṡʦʨʥŋɲcɟħðrṁṅḥkgġhłƛɬḍ]"


Line 78: Line 78:
end
end


-- The main entry point.
]]
-- This is the only function that can be invoked from a template.
 
function export.show(frame)
local function detect_decl(word, sv) -- stressed vowel
local parent_args = frame:getParent().args
local args = {}
local decl_type = "i-a-s"
local gender, word = parent_args[1], parent_args[2]~=nil and dedigraphize(parent_args[2]) or dedigraphize(PAGENAME)
local quality = parent_args[3]~=nil and parent_args[3] or detect_quality(word)
args = require("Module:parameters").process(parent_args, m_data[decl_type].params, true)
return word
local prefix = sub(PAGENAME, 1, -(#word+1))
return stressed_components(word) .. " " .. lenition(word)
end
end


Line 112: Line 103:
numbers = {parent_args[1]}
numbers = {parent_args[1]}
else
else
decl_type, numbers = export.detect_decl(word, parent_args.n, parent_args.c)
decl_type, numbers = export.detect_decl(word, sw)
end
end
end
end
Line 134: Line 125:
data.proper = parent_args["proper"] and true or false
data.proper = parent_args["proper"] and true or false
data.nocat = parent_args["nocat"] and true or false
data.nocat = parent_args["nocat"] and true or false
data.sv = parent_args[1] or error("Parameter 1 must be the word's stressed vowel.")
-- Generate the forms
-- Generate the forms