Module:head: Difference between revisions

Jump to navigation Jump to search
ਕੋਈ ਸੋਧ ਸਾਰ ਨਹੀਂ
No edit summary
No edit summary
Line 4: Line 4:
local m_gender_and_number = require("Module:gender and number")
local m_gender_and_number = require("Module:gender and number")
local m_formatting = require("Module:formatting")
local m_formatting = require("Module:formatting")
local function pluralize(word)
local ending = string.sub(word, -1)
if ending == "h" and string.sub(word, -2, -1) == "s" then ending = "sh" end
if ending == "s" or ending == "z" or ending == "x" or ending == "sh" then
return word .. "es"
end
return word .. "s"
end


local function format_headword(data)
local function format_headword(data)
local cats = "[[Category:" .. data.language.name .. " lemmas]]"
local cats = "[[Category:" .. data.language.name .. " lemmas]]"
cats = cats .. "[[Category:" .. data.language.name .. " " .. data.pos .. "s]]"
cats = cats .. "[[Category:" .. data.language.name .. " " .. pluralize(data.pos) .. "]]"
local head = data.term
local head = data.term
if data.head then
if data.head then

Navigation menu