Module:qhv-headword: Difference between revisions

No edit summary
No edit summary
Line 1: Line 1:
local export = {}
local export = {}
local pos_functions = {}
local pos_functions = {}
local sub = mw.ustring.sub
local find = mw.ustring.find
local match = mw.ustring.match
local gsub = mw.ustring.gsub
local u = mw.ustring.char
local split = mw.text.split
local gsplit = mw.text.gsplit


local legal_gender = {
local legal_gender = {
Line 32: Line 40:


local function detect_gender(word)
local function detect_gender(word)
local ending = sub(word, -1)
return "?"
if ending == "a" or ending == "y" or ending == "o" or ending == "e" or ending == "i" then
return "lun"
elseif ending == "r" then
return "aq"
elseif ending == "s" then
return "sol"
elseif ending == "n" then
return "ter"
else return "?" end
end
end