Module:qhv-verb/head: Difference between revisions
Jump to navigation
Jump to search
(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...") |
No edit summary |
||
(3 intermediate revisions by the same user not shown) | |||
Line 5: | Line 5: | ||
local PAGENAME = mw.title.getCurrentTitle().text | local PAGENAME = mw.title.getCurrentTitle().text | ||
function export.fetch(term) | function export.fetch(tense, term) | ||
local word = term or PAGENAME | local word = term or PAGENAME | ||
local data = {forms = {}, categories = {}} | local data = {forms = {}, categories = {}} | ||
data.thematic_vowel = mw.ustring.sub(word, -4, -4) | |||
local decl, stem = m_p.detect_decl(word) | local decl, stem = m_p.detect_decl(word) | ||
Line 15: | Line 16: | ||
else m_d[decl](stem, data) end | else m_d[decl](stem, data) end | ||
return data.forms | return data.forms[tense] | ||
end | end | ||
return export | return export |
Latest revision as of 11:35, 26 April 2021
- The following documentation is located at Module:qhv-verb/head/doc.[edit]
- Useful links: root page • root page's subpages • links • transclusions • testcases • sandbox
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(tense, term)
local word = term or PAGENAME
local data = {forms = {}, categories = {}}
data.thematic_vowel = mw.ustring.sub(word, -4, -4)
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[tense]
end
return export