Module:rad-stem/templates: Difference between revisions

m
ਕੋਈ ਸੋਧ ਸਾਰ ਨਹੀਂ
mNo edit summary
mNo edit summary
Line 9: Line 9:


local C = "bcdðfghħjĵkķlmnņpqrsștvwxzþ°"
local C = "bcdðfghħjĵkķlmnņpqrsștvwxzþ°"
local format_table = {}
function add(code)
table.insert(format_table, code)
end
function th(data, rowspan, colspan)
local to_add = "<th"
if rowspan and rowspan~=1 then to_add = to_add .. " rowspan=" .. rowspan end
if colspan and colspan~=1 then to_add = to_add .. " colspan=" .. colspan end
to_add = to_add .. ">" .. data .. "</th>"
add(to_add)
end
function td(data, rowspan, colspan)
local to_add = "<td"
if rowspan and rowspan~=1 then to_add = to_add .. " rowspan=" .. rowspan end
if colspan and colspan~=1 then to_add = to_add .. " colspan=" .. colspan end
to_add = to_add .. ">" .. data .. "</td>"
add(to_add)
end


function get_stems(args)
function get_stems(args)
Line 104: Line 126:
local post = args['post']
local post = args['post']
local format_table = {}
format_table = {}
local decl_type = {
local decl_type = {
Line 117: Line 139:
local table_type = args['type'] or args['t'] or "sgpl"
local table_type = args['type'] or args['t'] or "sgpl"
local function add(code)
table.insert(format_table, code)
end
local function th(data, rowspan, colspan)
local to_add = "<th"
if rowspan and rowspan~=1 then to_add = to_add .. " rowspan=" .. rowspan end
if colspan and colspan~=1 then to_add = to_add .. " colspan=" .. colspan end
to_add = to_add .. ">" .. data .. "</th>"
add(to_add)
end
local function td(data, rowspan, colspan)
local to_add = "<td"
if rowspan and rowspan~=1 then to_add = to_add .. " rowspan=" .. rowspan end
if colspan and colspan~=1 then to_add = to_add .. " colspan=" .. colspan end
to_add = to_add .. ">" .. data .. "</td>"
add(to_add)
end
-- generate forms --
-- generate forms --
Line 443: Line 445:
return table.concat(format_table, string.char(10))
return table.concat(format_table, string.char(10))
end
function export.conjugate(frame)
local args = getArgs(frame)
local pp = m_stem.getVerbStem(args)
mw.logObject(pp)
end
end