Module:Dict: Difference between revisions

From Annwan’s Wiki
Jump to navigation Jump to search
No edit summary
Tag: Reverted
No edit summary
 
(4 intermediate revisions by the same user not shown)
Line 22: Line 22:
if sc and sc ~= "" then
if sc and sc ~= "" then
headword = frame:expandTemplate{ title = 'Scr', args = { sc, headword}}
headword = frame:expandTemplate{ title = 'Scr', args = { sc, headword}}
else
headword = "'''" .. headword .. "'''"
end
end
return headword .. translit .. " " .. ipa .. " ''" .. pos .. ".''\n"
return headword .. translit .. " " .. ipa .. " ''" .. pos .. ".''\n"
.. "[[Category:" .. langdata[lang].display_name .. " " .. "posdata[pos]" .. "]]\n"
.. "[[Category:" .. tostring(langdata[lang].display_name) .. " " .. tostring(posdata[pos]) .. "]]\n"
.. "[[Category:" .. langdata[lang].display_name .. " Lemmas]]"
.. "[[Category:" .. tostring(langdata[lang].display_name) .. " Lemmas]]"
end
end


return exports
return exports

Latest revision as of 19:18, 1 April 2025


local exports = {}

local langdata = require('Module:Data/Langs')
local posdata = require('Module:Data/POS')

exports.head = function(frame)
	local headword = frame.args[1]
	local lang = frame.args["lang"]
	local pos = frame.args["pos"]
	local translit = frame.args["translit"]
	local sc = frame.args["sc"]
	local ipa = frame.args["ipa"]
	assert(lang)
	assert(pos)
	assert(ipa)
	ipa = frame:expandTemplate{ title = "IPA", args = {"/" .. ipa .. "/" }}
	if (not translit) or translit == "" then
		translit = ""
	else
		translit = " (" .. translit .. ")"
	end
	if sc and sc ~= "" then
		headword = frame:expandTemplate{ title = 'Scr', args = { sc, headword}}
	else
		headword = "'''" .. headword .. "'''"
	end
	return headword .. translit .. " " .. ipa .. " ''" .. pos .. ".''\n"
		.. "[[Category:" .. tostring(langdata[lang].display_name) .. " " .. tostring(posdata[pos]) .. "]]\n"
		.. "[[Category:" .. tostring(langdata[lang].display_name) .. " Lemmas]]"
end

return exports