Module:anui-headword: Difference between revisions

From Linguifex
Jump to navigation Jump to search
(Created page with "local export = {} return export")
 
No edit summary
Line 1: Line 1:
local export = {}
local export = {}


local lang = require("Module:languages").getByCode("art-nui")
local data = {lang = lang, pos_category = "adjectives", categories = {}, inflections = {},}


local function glossary_link(entry, text)
text = text or entry
return "[[w:Appendix:Glossary#" .. entry .. "|" .. text .. "]]"
end


local function redup(word)
return redup
end


 
function export.show()
local args = frame:getParent().args
local word = mw.title.getCurrentTitle().text or args["w"]
if args[1] == '-' then
table.insert(data.inflections, {label = "not " .. glossary_link("comparable")})
table.insert(data.categories, lang:getCanonicalName() .. " uncomparable adjectives")
else
table.insert(data.inflections, {label = glossary_link("comparative"), redup(word)})
end
return require('Module:headword').full_headword(data)
end


return export
return export

Revision as of 11:19, 7 July 2021



local export = {}

local lang = require("Module:languages").getByCode("art-nui")
local data = {lang = lang, pos_category = "adjectives", categories = {}, inflections = {},}

local function glossary_link(entry, text)
	text = text or entry
	return "[[w:Appendix:Glossary#" .. entry .. "|" .. text .. "]]"
end

local function redup(word)
	
	
	return redup
end

function export.show()
	local args = frame:getParent().args
	local word = mw.title.getCurrentTitle().text or args["w"]
	
	if args[1] == '-' then
		table.insert(data.inflections, {label = "not " .. glossary_link("comparable")})
		table.insert(data.categories, lang:getCanonicalName() .. " uncomparable adjectives")
	else
		table.insert(data.inflections, {label = glossary_link("comparative"), redup(word)})
	end
	
	return require('Module:headword').full_headword(data)
end

return export