Module:rad-stem/templates: Difference between revisions

Jump to navigation Jump to search
ਕੋਈ ਸੋਧ ਸਾਰ ਨਹੀਂ
mNo edit summary
No edit summary
Line 4: Line 4:
local m_stem = require("Module:rad-stem")
local m_stem = require("Module:rad-stem")
local m_parameters = require("Module:parameters")
local m_parameters = require("Module:parameters")
local m_links = require("Module:links")
local m_languages = require("Module:languages")


function get_stems(args)
function get_stems(args)
Line 32: Line 34:


function rad_link(word)
function rad_link(word)
return require("Module:links").full_link{
return m_links.full_link{
     term = word,
     term = word,
     language = m_languages.get_by_code("rad")
     language = m_languages.get_by_code("rad")
Line 49: Line 51:
function export.show(frame)
function export.show(frame)
local args = getArgs(frame)
local args = getArgs(frame)
local stems = get_stems(args)
local stem_gen = get_stems(args)
local stems = {
nom = args['nom'] or stem_gen.nom,
acc = args['acc'] or stem_gen.acc,
dat = args['dat'] or stem_gen.dat,
gen = args['gen'] or stem_gen.gen,
ins = args['ins'] or stem_gen.ins,
nompl = args['nompl'] or stem_gen.nompl,
genpl = args['genpl'] or stem_gen.genpl,
genpl_short = args['genpl_short'] or stem_gen.genpl_short,
['type'] = stem_gen['type']
}
local adj = args['adj']
local adj = args['adj']
local adj_broken = ""
local adj_broken = ""
Line 95: Line 108:
if table_type == "sgpl" then
if table_type == "sgpl" then
th("Declension of <i>" .. stems.nom .. "</i> (" .. type_name .. ") &nbsp", 1, 4)
th("Declension of <i>" .. stems.nom .. "</i> (" .. type_name .. ") &nbsp", 1, 4)
add("<tr>")
th("nominative", 1, 2)
if stems.nom == stems.nompl then
td(
rad_link(stems.nom),
1, 2
)
else
td(
rad_link(stems.nom)
)
td(
rad_link(stems.nompl)
)
end
add("</tr>")
elseif table_type == "sg" then
elseif table_type == "pl" then
elseif table_type == "du" then
elseif table_type == "dupl" then
end
end
add("</table>")
add("</table>")
add("<includeonly>[[Category:Radestrian " .. type_name .. " stems]]</includeonly>")
add("<includeonly>")
add("[[Category:" .. m_languages.get_by_code("rad").name .. " " .. type_name .. " stems]]")
if table_type == "sg" then add("[[Category:" .. m_languages.get_by_code("rad").name .. " singularia tantum]]")
elseif table_type == "pl" then add("[[Category:" .. m_languages.get_by_code("rad").name .. " pluralia tantum]]")
elseif table_type == "du" then add("[[Category:" .. m_languages.get_by_code("rad").name .. " pluralia binaria]]")
elseif table_type == "dupl" then add("[[Category:" .. m_languages.get_by_code("rad").name .. " pluralia binaria tantum]]")
end
add("</includeonly>")
return table.concat(format_table, string.char(10))
return table.concat(format_table, string.char(10))

Navigation menu