মডিউল:যোজকচিহ্নের ব্যবহার

উইকিঅভিধান, মুক্ত অভিধান থেকে

এই মডিউলের জন্য মডিউল:যোজকচিহ্নের ব্যবহার/নথি-এ নথিপত্র তৈরি করা হয়ে থাকতে পারে

local export = {}

local categorise_syllables = {
	["es"] = true,
	["fr"] = true,
	["it"] = true,
	["pt"] = true,
}

function export.hyphenation(frame)
	local parent_args = frame:getParent().args
	local compat = parent_args["lang"]
	local offset = compat and 0 or 1
	local params = {
		[compat and "lang" or 1] = {required = true, default = "und"},
		[1 + offset] = {list = true, required = true, default = "{{{2}}}"},
		
		["caption"] = {},
		["nocaption"] = {type = "boolean"},
		["sc"] = {},
	}
	
	local args = require("Module:parameters").process(parent_args, params)
	
	local lang = args[compat and "lang" or 1]
	local lang = require("Module:languages").getByCode(lang) or error("ভাষা কোড \"" .. lang .. "\" বৈধ নয়।")
	local sc = args["sc"] and (require("Module:scripts").getByCode(args["sc"]) or error("লিপি কোড \"" .. sc .. "\" বৈধ নয়।")) or nil
	
	local text = require("Module:links").full_link({lang = lang, sc = sc, alt = table.concat(args[1 + offset], "‧"), tr = "-"})
	local category = ""
	
--	if categorise_syllables[lang:getCode()] then
--		category = require("Module:utilities").format_categories({lang:getCanonicalName() .. " " .. tostring(#args[1 + offset]) .. "-syllable words"}, lang)
--	end
	
	return (args["nocaption"] and "" or (args["caption"] or "যোজকচিহ্নের ব্যবহার") .. ": ") .. text .. category
end

return export