Module:qay-noun: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
Tag: Reverted
No edit summary
Tags: Manual revert Reverted
Line 35: Line 35:
local word = NAMESPACE == "Template" and "bahis" or parent_args.word or PAGENAME
local word = NAMESPACE == "Template" and "bahis" or parent_args.word or PAGENAME
local args = {}
local args = {}
local decl_type = NAMESPACE == "Template" and "in_c" or parent_args["decl"] or genders[parent_args[1]] .. "_" .. detect_decl(word)
local decl_type = NAMESPACE == "Template" and "in_c" or sub(genders[parent_args[1]],1,2) .. "_" .. detect_decl(word) or parent_args["decl"]
if not genders[g] then error("Unknown gender.") end
if not genders[g] then error("Unknown gender.") end
Line 55: Line 55:
end
end
args = require("Module:parameters").process(parent_args, m_data[decl_type].params, true)
args = require("Module:parameters").process(parent_args, m_data[sub(genders[parent_args[1]],1,2) .. "_" .. decl_type].params, true)
if numbers then
if numbers then
Line 71: Line 71:
data.g = genders[g]
data.g = genders[g]
data.nopl = parent_args["nopl"] and true or false
data.nopl = parent_args["nopl"] and true or false
data.pt = parent_args["pt"] and true or false
if data.proper then data.nopl = true end
if data.proper then data.nopl = true end
data.decl_type = decl_type
data.decl_type = decl_type
Line 134: Line 133:
local case_short = sub(case, 1, 3)
local case_short = sub(case, 1, 3)
table.insert(ret, '|- \n! style="background-color:#FFF0DC" | ' .. case .. '\n')
table.insert(ret, '|- \n! style="background-color:#FFF0DC" | ' .. case .. '\n')
if not data.pt then
table.insert(ret, '| ' .. link(show_form(data.forms[case_short .. '_s'])) .. '\n')
table.insert(ret, '| ' .. link(show_form(data.forms[case_short .. '_s'])) .. '\n')
end
if not data.nopl then
if not data.nopl then
table.insert(ret, '| ' .. link(show_form(data.forms[case_short .. '_p'])) .. '\n')
table.insert(ret, '| ' .. link(show_form(data.forms[case_short .. '_p'])) .. '\n')
Line 154: Line 151:
|-
|-
!  
!  
]=] .. (data.pt and "\n" or [=[
! style="background-color:#F4E6AC" | Singular
! style="background-color:#F4E6AC" | Singular
]=]) .. (data.nopl and "\n" or [=[
]=] .. (data.nopl and "\n" or [=[
! style="background-color:#F4E6AC" | Plural
! style="background-color:#F4E6AC" | Plural
]=]) .. make_cases(data) .. [=[
]=]) .. make_cases(data) .. [=[

Navigation menu