Module:qhv-noun/head: Difference between revisions

From Linguifex
Jump to navigation Jump to search
No edit summary
No edit summary
Line 16: Line 16:
else m_d[decl](stem, data) end
else m_d[decl](stem, data) end
return table.concat(data.forms)
return table.concat(data[1])
end
end


return export
return export

Revision as of 14:54, 4 March 2021



local export = {}

local m_p = require("Module:qhv-noun")
local m_d = require("Module:qhv-noun/data")
local PAGENAME = mw.title.getCurrentTitle().text

function export.generate(frame)
	local case = frame.args[1]
	local word = frame.args[2] or PAGENAME
	local data = {forms = {}, categories = {}}
	local decl, stem = m_p.detect_decl(word)
	
	stem = {table.concat(stem), "a"}
	
	if m_d[word] then m_d[word](stem, data)
	else m_d[decl](stem, data) end
	
	return table.concat(data[1])
end

return export