Hello, you have come here looking for the meaning of the word . In DICTIOUS you will not only get to know all the dictionary meanings for the word , but we will also tell you about its etymology, its characteristics and you will know how to say in singular and plural. Everything you need to know about the word you have here. The definition of the word will help you to be more precise and correct when speaking or writing your texts. Knowing the definition of, as well as those of other words, enriches your vocabulary and provides you with more and better linguistic resources.


local export = {}

local references = { "AIS", "ALF", "ALLy", "ALP", "ALV", "APV", "DFF", "DGL", "DLG", 
	"DPB", "DSV", "LPT", "MHN", "PVA", "SSV", "TPh", "VFC", "VIV" }
export.references = references

local VIV_code = {
	 = "Abruzzo",
	 = "Basilicata",
	 = "Calabria",
	 = "Campania",
	 = "Emilia-Romagna",
	 = "Friuli-Venezia Giulia",
	 = "Lazio",
	 = "Liguria",
	 = "Lombardy",
	 = "Molise",
	 = "Piedmont",
	 = "Apulia",
	 = "Sardinia",
	 = "Sicily",
	 = "Tuscany",
	 = "Trentino-South Tyrol",
	 = "Umbria",
	 = "Aosta",
	 = "Veneto",
}
export.VIV_code = VIV_code

export.ref_data = {
AIS = {
	wikilink = "WT:AFRP#AIS",
	map = 1,
},
ALF = {
	wikilink = "WT:AFRP#ALF_2",
	map = 1,
},
ALLy = {
	wikilink = "WT:AFRP#ALLy_2",
	map = 1,
},
ALP = {
	wikilink = "WT:AFRP#ALP",
},
ALV = {
	wikilink = "WT:AFRP#ALV",
	url_format = "https://alaval.unine.ch/atlas?carte={2}&statement_id={3}"
},
APV = {
	wikilink = "WT:AFRP#APV",
	map = 1,
},
DFF = {
	wikilink = "WT:AFRP#DFF",
	url_format = "https://dicofranpro.llm.umontreal.ca/?chercher={1}",
	quotes = 1,
},
DGL = {
	wikilink = "WT:AFRP#DGL",
	quotes = 1,
},
DLG = {
	wikilink = "WT:AFRP#DLG",
	url_format = "https://www.rose.uzh.ch/docling/charte.php?c={2}&o=Ordre&t={3}"
},
DPB = {
	wikilink = "WT:AFRP#DPB",
	quotes = 1,
},
DSV = {
	wikilink = "WT:AFRP#DSV",
	quotes = 1,
},
LPT = {
	wikilink = "WT:AFRP#LPT",
	quotes = 1,
},
MHN = {
	wikilink = "WT:AFRP#MHN",
},
PhL = {
	wikilink = "WT:AFRP#PhL",
},
PVA = {
	wikilink = "WT:AFRP#PVA",
	url_format = "https://www.patoisvda.org/moteur-de-recherche/{1}_{2}",
	quotes = 1,
},
SSV = {
	wikilink = "WT:AFRP#SSV",
},
TPh = {
	wikilink = "WT:AFRP#TPh_2",
},
VFC = {
	wikilink = "WT:AFRP#VFC",
	quotes = 1,
},
VIV = {
	wikilink = "WT:AFRP#VIV",
	text_format = "{0} ({2})",
	quotes = 1,
	preprocess = function(args)
		args = args:gsub("=","/"):gsub("m%w%d%d%d", function(code)
			return "[https://www2.hu-berlin.de/vivaldi/index.php?id=" .. code
				.. "&lang=it " .. VIV_code .. "]"
		end)
	end
},
}

function export.format(text, args, field, mode)
	local used = {}
	text = text:gsub("{(%d)}", function(idx)
		idx = tonumber(idx)
		used = true
		if not args then
			error("Missing positional argument number " .. idx .. " for source " .. field)
		end
		return mode == "url" and mw.uri.encode(args, "PATH") or args
	end)
	
	for i=2,#args do
		if not used then
			error("Unused positional argument number " .. i .. " for source " .. field)
		end
	end
	
	return text
end

-- process each source according to the format specified in export.ref_data
-- within <content>, each item is separated by ","
-- in each item, the arguments are separated by "/"
-- in each argument, each sub-item is seprated by "="
function export.process(name, content)
	local data = export.ref_data
	if not data then error("Unrecognised source: " .. name) end
	
	-- process the name according to data.link and data.wikilink
	if data.link then
		name = ""
	elseif data.wikilink then
		name = "]"
	end
	
	-- prepend "map" if data.map is specified
	local items = mw.text.split(content, ",", true)
	local prepend = ""
	if data.map then
		prepend = "map" .. (#items > 1 and "s " or " ")
	end
	
	for i=1,#items do
		if data.url_format or data.quotes or data.text_format then
			local args = mw.text.split(items, "/", true)
			
			args = data.quotes and ('“' .. args .. '”') or args
			
			if data.preprocess then
				data.preprocess(args)
			end
			
			if data.url_format then
				items = " .. "]"
			elseif data.text_format then
				items = export.format(data.text_format, args, name)
			else
				if args then
					error("Source " .. name .. " should not have more than one argument.")
				end
				items = args
			end
		end
	end
	
	return name .. ": " .. prepend .. table.concat(items, ", ")
end

-- each source is denoted as "<name>:<content>" and separated by ";"
function export.format_ref(text, filter)
	if not text then return nil end
	local result = ""
	local seen = {}
	for source in mw.text.gsplit(text, ";", true) do
		name, content = source:match("^(+):(.+)$")
		if not name then error("Wrong format: " .. source) end
		if seen then error("Duplicated source: " .. name) end
		seen = 1
		if (not filter) or filter then
			result = result .. "* " .. export.process(name, content) .. "\n"
		end
	end
	if filter then
		for _, ref in ipairs(references) do
			if filter and not seen then
				error("Reference used but not specified: " .. ref)
			end
		end
	end
	return result
end

function export.make_ref(sources, cf, note, filter)
	local formatted_sources = export.format_ref(sources, filter)
	return (sources and "\nSources:\n" .. formatted_sources or "")
		.. (cf and "\nCf. also:\n" .. export.format_ref(cf) or "")
		.. (note and mw.getCurrentFrame():preprocess(note) or "")
end

return export