Module:head: Difference between revisions

ਕੋਈ ਸੋਧ ਸਾਰ ਨਹੀਂ
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 is_non_lemma(pos)
return string.find(pos, "%sform") and true or false
end


local function pluralize(word)
local function pluralize(word)
Line 15: Line 19:


local function format_headword(data)
local function format_headword(data)
local cats = "[[Category:" .. data.language.name .. " lemmas]]"
local cats = ""
if is_non_lemma(data.pos) then
cats = cats .. "[[Category:" .. data.language.name .. " non-lemmas]]"
else
cats = cats .. "[[Category:" .. data.language.name .. " lemmas]]"
end
cats = cats .. "[[Category:" .. data.language.name .. " " .. pluralize(data.pos) .. "]]"
cats = cats .. "[[Category:" .. data.language.name .. " " .. pluralize(data.pos) .. "]]"
local head = data.term
local head = data.term