Module:snon-headword: Difference between revisions
No edit summary |
No edit summary |
||
| Line 239: | Line 239: | ||
----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ||
-- Adjectives | -- Adjectives -- | ||
----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ||
| Line 303: | Line 303: | ||
}, | }, | ||
func = do_adj, | func = do_adj, | ||
} | |||
----------------------------------------------------------------------------------------- | |||
-- Verbs -- | |||
----------------------------------------------------------------------------------------- | |||
local function do_verb(args, data) | |||
local category_pos = m_en_util.singularize(data.pos_category) | |||
local lemma = data.pagename | |||
if args.irr then | |||
-- irregular verb | |||
table.insert(data.categories, langname .. " irregular verbs") | |||
else | |||
local presents = m_hw_util.parse_term_list_with_modifiers { | |||
paramname = "pres", | |||
forms = args.pres, | |||
splitchar = ",", | |||
} | |||
if not presents[1] then | |||
presents = {{term = lemma .. "ir"}} | |||
else | |||
local new_presents = {} | |||
for _, p in ipairs(presents) do | |||
if p.term == "+" then | |||
table.insert(new_presents, {term = lemma .. "ir"}) | |||
else | |||
table.insert(new_presents, p) | |||
end | |||
end | |||
presents = new_presents | |||
end | |||
local pasts = m_hw_util.parse_term_list_with_modifiers { | |||
paramname = "past", | |||
forms = args.past, | |||
splitchar = ",", | |||
} | |||
if not pasts[1] then | |||
pasts = {{term = lemma .. "adhir"}} | |||
else | |||
local new_pasts = {} | |||
for _, p in ipairs(pasts) do | |||
if p.term == "+" then | |||
table.insert(new_pasts, {term = lemma .. "adhir"}) | |||
else | |||
table.insert(new_pasts, p) | |||
end | |||
end | |||
pasts = new_pasts | |||
end | |||
local futures = m_hw_util.parse_term_list_with_modifiers { | |||
paramname = "fut", | |||
forms = args.fut, | |||
splitchar = ",", | |||
} | |||
if not futures[1] then | |||
futures = {{term = lemma .. "ist"}} | |||
else | |||
local new_futures = {} | |||
for _, f in ipairs(futures) do | |||
if f.term == "+" then | |||
table.insert(new_futures, {term = lemma .. "ist"}) | |||
else | |||
table.insert(new_futures, f) | |||
end | |||
end | |||
futures = new_futures | |||
end | |||
local statives = m_hw_util.parse_term_list_with_modifiers { | |||
paramname = "stat", | |||
forms = args.stat, | |||
splitchar = ",", | |||
} | |||
if not statives[1] then | |||
statives = {{term = lemma .. "adhist"}} | |||
else | |||
local new_statives = {} | |||
for _, s in ipairs(statives) do | |||
if s.term == "+" then | |||
table.insert(new_statives, {term = lemma .. "adhist"}) | |||
else | |||
table.insert(new_statives, s) | |||
end | |||
end | |||
statives = new_statives | |||
end | |||
insert_inflection(data, presents, "present") | |||
insert_inflection(data, pasts, "past") | |||
insert_inflection(data, futures, "future") | |||
insert_inflection(data, statives, "stative") | |||
end | |||
end | |||
pos_functions["verbs"] = { | |||
params = { | |||
["pres"] = {list = true, disallow_holes = true}, | |||
["past"] = {list = true, disallow_holes = true}, | |||
["fut"] = {list = true, disallow_holes = true}, | |||
["stat"] = {list = true, disallow_holes = true}, | |||
["irr"] = {type = "boolean"}, | |||
}, | |||
func = do_verb, | |||
} | } | ||
return export | return export | ||