Module:qhv-verb/head

From Linguifex
< Module:qhv-verb
Revision as of 11:05, 26 April 2021 by Sware (talk | contribs) (Created page with "local export = {} local m_p = require("Module:qhv-verb") local m_d = require("Module:qhv-verb/data") local PAGENAME = mw.title.getCurrentTitle().text function export.fetch(t...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search


local export = {}

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

function export.fetch(term)
	local word = term 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 data.forms
end

return export