Module:anui-headword: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 26: Line 26:
end
end


local function redup(word)
local function redup(word, grave)
word = word:gsub("([ḛḭṵaɔ]" .. TILDEB .. "?)", {["ḛ"] = "è", ["ḭ"] = "ì", ["ṵ"] = "ù", ["a" .. TILDEB] = "à", ["o" .. TILDEB] = "ò"})
word = word:gsub("([ḛḭṵaɔ]" .. TILDEB .. "?)", {["ḛ"] = "è", ["ḭ"] = "ì", ["ṵ"] = "ù", ["a" .. TILDEB] = "à", ["o" .. TILDEB] = "ò"})
word = m(word)
word = m(word)
Line 48: Line 48:
word = word:gsub("ᴍ", "m")
word = word:gsub("ᴍ", "m")
if not args["grave"] then
if not grave then
word = word:gsub("[àèìòù]", {["è"] = "ḛ", ["ì"] = "ḭ", ["ù"] = "ṵ", ["à"] = "a" .. TILDEB, ["ò"] = "o" .. TILDEB})
word = word:gsub("[àèìòù]", {["è"] = "ḛ", ["ì"] = "ḭ", ["ù"] = "ṵ", ["à"] = "a" .. TILDEB, ["ò"] = "o" .. TILDEB})
end
end
Line 67: Line 67:
end
end
elseif pos ~= "v" then
elseif pos ~= "v" then
table.insert(data.inflections, {label = glossary_link("comparative"), redup(word)})
table.insert(data.inflections, {label = glossary_link("comparative"), redup(word, args["grave"])})
if pos == "adverbs" then table.insert(data.categories, lang:getCanonicalName() .. " comparative " .. pos) end
if pos == "adverbs" then table.insert(data.categories, lang:getCanonicalName() .. " comparative " .. pos) end
else
else
table.insert(data.inflections, {label = "[[w:applicative voice|applicative]]", redup(word)})
table.insert(data.inflections, {label = "[[w:applicative voice|applicative]]", redup(word, args["grave"])})
end
end