Module:affix/pseudo-loan

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


local export = {}

local debug_force_cat = false -- set to true for testing

local m_affix = require("Module:affix")

local pseudo_loan_by_source = {
	 = "Arabism",
	 = "Germanism",
	 = "anglicism",
	 = "Hispanism",
	 = "Gallicism",
	 = "Italianism",
	 = "Japonism",
	 = "Latinism",
}

local function get_pseudo_loan_text(lang, source, has_parts, nocap)
	local langcode = lang:getCode()
	local sourcecode = source:getCode()
	local function glossary_pseudo_loan_link(display)
		return "]"
	end
	local text
	if langcode == "ja" and sourcecode == "en" then
		local ja_link = require("Module:links").full_link({
			term = "和製英語",
			lang = require("Module:languages").getByCode("ja"),
			tr = "-"
		}, "term")
		text = "] (" .. ja_link .. "; " .. glossary_pseudo_loan_link("pseudo-anglicism") .. ")"
	elseif pseudo_loan_by_source then
		text = glossary_pseudo_loan_link((nocap and "p" or "P") .. "seudo-" .. pseudo_loan_by_source)
	else
		text = glossary_pseudo_loan_link((nocap and "p" or "P") .. "seudo-loan") .. " from " .. source:getCanonicalName()
	end
	if has_parts then
		-- When nocap= is specified, the pseudo-loan template is being used in the middle of a sentence and the comma
		-- doesn't make so much sense, e.g. on ], which uses `{{cal|...}}, a {{wasei eigo|nocap=y|nocat=y|light|novel}}`,
		-- where it reads better as "Calque of ..., a pseudo-loan (wasei eigo) derived from ..." instead of
		-- "Calque of ..., a pseudo-loan (wasei eigo), derived from ...". If this proves problematic in general, we will need
		-- a separate parameter to control the appearance of the comma.
		text = text .. (nocap and " " or ", ") .. "derived from "
	end
	return text
end


function export.show_pseudo_loan(data)
	local parts_formatted = {}
	local categories = {}

	data.force_cat = data.force_cat or debug_force_cat

	if not data.nocat then
		table.insert(categories, "pseudo-loans from " .. data.source:getCanonicalName())
		table.insert(categories, "terms derived from " .. data.source:getCanonicalName())
	end

	-- Make links out of all the parts
	for i, part in ipairs(data.parts) do
		part.part_lang = part.lang
		-- When the part is in the source language, we need to use `source` so the part gets linked correctly. Otherwise,
		-- `data.lang` will be used, which is correct, because the value is used as the destination language in
		-- derived-from categories. An example is ], a German pseudo-loan from English but where the
		-- first part is from Latin.
		part.lang = part.lang or data.source
		part.sc = part.sc or data.sc
		table.insert(parts_formatted, m_affix.link_term(part, data))
	end

	local text_sections = {}
	if not data.notext then
		table.insert(text_sections, get_pseudo_loan_text(data.lang, data.source, #data.parts > 0, data.nocap))
	end
	table.insert(text_sections, m_affix.join_formatted_parts {
		data = data, parts_formatted = parts_formatted, categories = categories}
	)
	return table.concat(text_sections)
end


return export