text:
Module:User:Benwing2/pt-headword

-- This module contains code for Portuguese headword templates. -- Templates covered are: -- *, ; -- * ; -- * , , ; -- * ; -- * ; -- * ; -- * ; -- * ; -- * . -- See Module:pt-verb for Portuguese conjugation templates.

local export = {} local pos_functions = {}

local force_cat = false -- for testing; if true, categories appear in non-mainspace pages

local m_links = require("Module:links") local m_table = require("Module:table") local com = require("Module:pt-common") local romut_module = "Module:romance utilities" local pt_verb_module = "Module:User:Benwing2/pt-verb" local lang = require("Module:languages").getByCode("pt") local langname = lang:getCanonicalName

local rfind = mw.ustring.find local rmatch = mw.ustring.match local rsplit = mw.text.split local usub = mw.ustring.sub

-- When followed by a hyphen in a hyphenated compound, the hyphen will be included with the prefix when linked. local include_hyphen_prefixes = m_table.listToSet { "ab", "afro", "anarco", "anglo", "ântero", "anti", "auto", "contra", "ex", "franco", "hiper", "infra", "inter", "intra", "macro", "micro", "neo", "pan", "pós", "pré", "pró", "proto", "sobre", "sub", "super", "vice", }

local function track(page) require("Module:debug/track")("pt-headword/" .. page) return true end

local function glossary_link(entry, text) text = text or entry return "" .. text .. "" end

local metaphonic_label = "metaphonic"

local function check_all_missing(forms, plpos, tracking_categories) for _, form in ipairs(forms) do		if type(form) == "table" then form = form.term end if form then local title = mw.title.new(form) if title and not title.exists then table.insert(tracking_categories, langname .. " " .. plpos .. " with red links in their headword lines") end end end end

-- The main entry point. -- This is the only function that can be invoked from a template. function export.show(frame) local poscat = frame.args[1] or error("Part of speech has not been specified. Please pass parameter 1 to the module invocation.")

local parargs = frame:getParent.args

local params = { ["head"] = {list = true}, ["id"] = {}, ["splithyph"] = {type = "boolean"}, ["nolinkhead"] = {type = "boolean"}, ["json"] = {type = "boolean"}, ["pagename"] = {}, -- for testing }

if pos_functions[poscat] then for key, val in pairs(pos_functions[poscat].params) do			params[key] = val end end

local args = require("Module:parameters").process(parargs, params)

local pagename = args.pagename or mw.title.getCurrentTitle.text

local user_specified_heads = args.head local heads = user_specified_heads if args.nolinkhead then if #heads == 0 then heads = {pagename} end else local romut = require(romut_module) local auto_linked_head = romut.add_links_to_multiword_term(pagename, args.splithyph, nil,			include_hyphen_prefixes) if #heads == 0 then heads = {auto_linked_head} else for i, head in ipairs(heads) do				if head:find("^~") then head = romut.apply_link_modifiers(auto_linked_head, usub(head, 2)) heads[i] = head end end end end

local data = { lang = lang, pos_category = poscat, categories = {}, heads = heads, user_specified_heads = user_specified_heads, no_redundant_head_cat = #user_specified_heads == 0, genders = {}, inflections = {}, pagename = pagename, id = args.id, force_cat_output = force_cat, }

local is_suffix = false if pagename:find("^%-") and poscat ~= "suffix forms" then is_suffix = true data.pos_category = "suffixes" local singular_poscat = require("Module:string utilities").singularize(poscat) table.insert(data.categories, langname .. " " .. singular_poscat .. "-forming suffixes") table.insert(data.inflections, {label = singular_poscat .. "-forming suffix"}) end

local tracking_categories = {}

if pos_functions[poscat] then pos_functions[poscat].func(args, data, tracking_categories, frame, is_suffix) end

if args.json then return require("Module:JSON").toJSON(data) end

return require("Module:headword").full_headword(data) .. (#tracking_categories > 0 and require("Module:utilities").format_categories(tracking_categories, lang, nil, nil, force_cat) or "") end

local function fetch_qualifiers(qual, existing) if not qual then return existing end if not existing then return {qual} end local retval = {} for _, e in ipairs(existing) do		table.insert(retval, e)	end table.insert(retval, qual) return retval end

local function process_terms_with_qualifiers(terms, quals) local infls = {} for i, term in ipairs(terms) do		table.insert(infls, {term = term, q = fetch_qualifiers(quals[i])}) end return infls end

local function replace_hash_with_lemma(term, lemma) -- If there is a % sign in the lemma, we have to replace it with %% so it doesn't get interpreted as a capture replace -- expression. lemma = lemma:gsub("%%", "%%%%") -- Assign to a variable to discard second return value. term = term:gsub("#", lemma) return term end

local function is_metaphonic(args, lemma) if args.nometa then return false end if args.meta then return true end -- Anything in -oso with a preceding vowel (e.g. gostoso, curioso) is normally metaphonic. return rfind(lemma, com.V .. ".*oso$") end

- --                                         Nouns                                      -- -

local allowed_genders = m_table.listToSet(	{"m", "f", "mf", "mfbysense", "m-p", "f-p", "mf-p", "mfbysense-p", "?", "?-p", "n", "n-p"} )

local function process_genders(data, genders, g_qual) for i, g in ipairs(genders) do		if not allowed_genders[g] then error("Unrecognized gender: " .. g)		end if g_qual[i] then table.insert(data.genders, {spec = g, qualifiers = {g_qual[i]}}) else table.insert(data.genders, g)		end end end

local function do_noun(args, data, tracking_categories, pos, is_suffix, is_proper) local is_plurale_tantum = false local has_singular = false if is_suffix then pos = "suffix" end local plpos = require("Module:string utilities").pluralize(pos)

data.genders = {} local saw_m = false local saw_f = false local gender_for_default_plural process_genders(data, args[1], args.g_qual) -- Check for specific genders and pluralia tantum. for i, g in ipairs(args[1]) do		if g:find("-p$") then is_plurale_tantum = true else has_singular = true if g == "m" or g == "mf" or g == "mfbysense" then saw_m = true end if g == "f" or g == "mf" or g == "mfbysense" then saw_f = true end end end if saw_m and saw_f then gender_for_default_plural = "m" elseif saw_f then gender_for_default_plural = "f" else gender_for_default_plural = "m" end

local lemma = m_links.remove_links(data.heads[1]) -- should always be specified

local function insert_inflection(list, term, accel, qualifiers, no_inv) local infl = {q = qualifiers, accel = accel} --if term == lemma and not no_inv then --	infl.label = glossary_link("invariable") --else infl.term = term --end infl.term_for_further_inflection = term table.insert(list, infl) end

-- Plural local plurals = {} local args_mpl = args.mpl local args_fpl = args.fpl local args_pl = args[2]

if is_plurale_tantum and not has_singular then if #args_pl > 0 then error("Can't specify plurals of plurale tantum " .. pos) end table.insert(data.inflections, {label = glossary_link("plural only")}) else if is_plurale_tantum then -- both singular and plural table.insert(data.inflections, {label = "sometimes " .. glossary_link("plural only") .. ", in variation"}) end -- If no plurals, use the default plural if not a proper noun. if #args_pl == 0 and not is_proper then args_pl = {"+"} end -- If only ~ given (countable and uncountable), add the default plural after it. if #args_pl == 1 and args_pl[1] == "~" then args_pl = {"~", "+"} end -- Gather plurals, handling requests for default plurals for i, pl in ipairs(args_pl) do			local function insert_pl(term) local quals = fetch_qualifiers(args.pl_qual[i]) if term == lemma and i == 1 and #args_pl == 1 then table.insert(data.inflections, {label = glossary_link("invariable"), q = quals}) table.insert(data.categories, langname .. " indeclinable " .. plpos) else insert_inflection(plurals, term, nil, quals) end table.insert(data.categories, langname .. " countable " .. plpos) end local function make_plural_and_insert(form, special) local pl = com.make_plural(lemma, special) if pl then insert_pl(pl) end end

if pl == "+" then make_plural_and_insert(lemma) elseif pl:find("^%+") then pl = require(romut_module).get_special_indicator(pl) make_plural_and_insert(lemma, pl) elseif pl == "?" or pl == "!" then if i > 1 or #args_pl > 1 then error("Can't specify ? or ! with other plurals") end if pl == "?" then -- Plural is unknown -- Better not to display anything -- table.insert(data.inflections, {label = "plural unknown or uncertain"}) table.insert(data.categories, langname .. " " .. plpos .. " with unknown or uncertain plurals") else -- Plural is not attested table.insert(data.inflections, {label = "plural not attested"}) table.insert(data.categories, langname .. " " .. plpos .. " with unattested plurals") end elseif pl == "-" then if i > 1 then error("Plural specifier - must be first") end -- Uncountable noun; may occasionally have a plural table.insert(data.categories, langname .. " uncountable " .. plpos)

-- If plural forms were given explicitly, then show "usually" if #args_pl > 1 then table.insert(data.inflections, {label = "usually " .. glossary_link("uncountable")}) table.insert(data.categories, langname .. " countable " .. plpos) else table.insert(data.inflections, {label = glossary_link("uncountable")}) end elseif pl == "~" then if i > 1 then error("Plural specifier ~ must be first") end -- Countable and uncountable noun; will have a plural table.insert(data.categories, langname .. " countable " .. plpos) table.insert(data.categories, langname .. " uncountable " .. plpos) table.insert(data.inflections, {label = glossary_link("countable") .. " and " .. glossary_link("uncountable")}) else insert_pl(replace_hash_with_lemma(pl, lemma)) end end end

if #plurals > 1 then table.insert(data.categories, langname .. " " .. plpos .. " with multiple plurals") end

-- Gather masculines/feminines. For each one, generate the corresponding plural(s). local function handle_mf(mfs, qualifiers, inflect, default_plurals) local retval = {} for i, mf in ipairs(mfs) do			local function insert_infl(list, term, accel, existing_qualifiers) insert_inflection(list, term, accel, fetch_qualifiers(qualifiers[i], existing_qualifiers), "no inv") end if mf == "+" then -- Generate default feminine. mf = inflect(lemma) else mf = replace_hash_with_lemma(mf, lemma) end local special = require(romut_module).get_special_indicator(mf) if special then mf = inflect(lemma, special) end insert_infl(retval, mf) local mfpl = com.make_plural(mf, special) if mfpl then -- Add an accelerator for each masculine/feminine plural whose lemma -- is the corresponding singular, so that the accelerated entry -- that is generated has a definition that looks like -- # 				insert_infl(default_plurals, mfpl, {form = "p", lemma = mf}) end end return retval end

local feminine_plurals = {} local feminines = handle_mf(args.f, args.f_qual, com.make_feminine, feminine_plurals) local masculine_plurals = {} local masculines = handle_mf(args.m, args.m_qual, com.make_masculine, masculine_plurals)

local function handle_mf_plural(mfpl, qualifiers, default_plurals, singulars) local new_mfpls = {} for i, mfpl in ipairs(mfpl) do			local function insert_infl(term, accel, existing_qualifiers, no_inv) insert_inflection(new_mfpls, term, accel, fetch_qualifiers(qualifiers[i], existing_qualifiers), no_inv) end local accel if #mfpl == #singulars then -- If same number of overriding masculine/feminine plurals as singulars, -- assume each plural goes with the corresponding singular -- and use each corresponding singular as the lemma in the accelerator. -- The generated entry will have # as the -- definition. accel = {form = "p", lemma = singulars[i].term} else accel = nil end if mfpl == "+" then if #default_plurals > 0 then for _, defpl in ipairs(default_plurals) do						-- defpl is a table -- don't use "invariable" because the plural is not with respect to the lemma but -- with respect to the masc/fem singular insert_infl(defpl.term_for_further_inflection, defpl.accel, defpl.q, "no inv") end else -- mf is a table local default_mfpl = com.make_plural(lemma) if default_mfpl then insert_infl(default_mfpl, accel) end end elseif mfpl:find("^%+") then mfpl = require(romut_module).get_special_indicator(mfpl) if #singulars > 0 then for _, mf in ipairs(singulars) do						-- mf is a table local default_mfpl = com.make_plural(mf.term_for_further_inflection, mfpl) if default_mfpl then -- don't use "invariable" because the plural is not with respect to the lemma but -- with respect to the masc/fem singular insert_infl(default_mfpl, accel, mf.q, "no inv") end end else local default_mfpl = com.make_plural(lemma, mfpl) if default_mfpl then insert_infl(default_mfpl, accel) end end else mfpl = replace_hash_with_lemma(mfpl, lemma) -- don't use "invariable" if masc/fem singular present because the plural is not with respect to				-- the lemma but with respect to the masc/fem singular insert_infl(mfpl, accel, nil, #singulars > 0) end end return new_mfpls end

if #args_fpl > 0 then -- Override feminine plurals. feminine_plurals = handle_mf_plural(args_fpl, args.fpl_qual, feminine_plurals, feminines) end

if #args_mpl > 0 then -- Override masculine plurals. masculine_plurals = handle_mf_plural(args_mpl, args.mpl_qual, masculine_plurals, masculines) end

check_all_missing(plurals, plpos, tracking_categories) check_all_missing(feminines, plpos, tracking_categories) check_all_missing(feminine_plurals, plpos, tracking_categories) check_all_missing(masculines, plpos, tracking_categories) check_all_missing(masculine_plurals, plpos, tracking_categories)

local function redundant_plural(pl) for _, p in ipairs(plurals) do			if p.term_for_further_inflection == pl.term_for_further_inflection then return true end end return false end

for _, mpl in ipairs(masculine_plurals) do		if redundant_plural(mpl) then track("noun-redundant-mpl") end end

for _, fpl in ipairs(feminine_plurals) do		if redundant_plural(fpl) then track("noun-redundant-fpl") end end

if #plurals > 0 then plurals.label = "plural" plurals.accel = {form = "p"} table.insert(data.inflections, plurals) end

if #masculines > 0 then masculines.label = "masculine" table.insert(data.inflections, masculines) end

if #masculine_plurals > 0 then masculine_plurals.label = "masculine plural" table.insert(data.inflections, masculine_plurals) end

if #feminines > 0 then feminines.label = "feminine" feminines.accel = {form = "f"} table.insert(data.inflections, feminines) end

if #feminine_plurals > 0 then feminine_plurals.label = "feminine plural" table.insert(data.inflections, feminine_plurals) end

if is_metaphonic(args, lemma) then table.insert(data.inflections, {label = metaphonic_label}) table.insert(data.categories, langname .. " " .. plpos .. " with metaphony") end

-- Maybe add category 'Portuguese nouns with irregular gender' (or similar) local irreg_gender_lemma = com.rsub(lemma, " .*", "") -- only look at first word if (rfind(irreg_gender_lemma, "[^ã]o$") and (gender_for_default_plural == "f" or gender_for_default_plural == "mf" or gender_for_default_plural == "mfbysense")) or		(irreg_gender_lemma:find("a$") and (gender_for_default_plural == "m" or gender_for_default_plural == "mf" or gender_for_default_plural == "mfbysense")) then table.insert(data.categories, langname .. " " .. plpos .. " with irregular gender") end end

local function get_noun_params return { [1] = {list = "g", required = true, default = "?"}, [2] = {list = "pl"}, ["g_qual"] = {list = "g=_qual", allow_holes = true}, ["pl_qual"] = {list = "pl=_qual", allow_holes = true}, ["m"] = {list = true}, ["m_qual"] = {list = "m=_qual", allow_holes = true}, ["f"] = {list = true}, ["f_qual"] = {list = "f=_qual", allow_holes = true}, ["mpl"] = {list = true}, ["mpl_qual"] = {list = "mpl=_qual", allow_holes = true}, ["fpl"] = {list = true}, ["fpl_qual"] = {list = "fpl=_qual", allow_holes = true}, ["meta"] = {type = "boolean"}, -- metaphonic ["nometa"] = {type = "boolean"}, -- explicitly not metaphonic } end

pos_functions["nouns"] = { params = get_noun_params, func = function(args, data, tracking_categories, frame, is_suffix) do_noun(args, data, tracking_categories, "noun", is_suffix) end, }

pos_functions["proper nouns"] = { params = get_noun_params, func = function(args, data, tracking_categories, frame, is_suffix) do_noun(args, data, tracking_categories, "proper noun", is_suffix, "is proper noun") end, }

- --                                       Pronouns                                     -- -

local function do_pronoun(args, data, tracking_categories, pos, is_suffix) if is_suffix then pos = "suffix" end local plpos = require("Module:string utilities").pluralize(pos)

if not is_suffix then data.pos_category = plpos end

local lemma = m_links.remove_links(data.heads[1]) -- should always be specified

data.genders = {} for i, g in ipairs(args[1]) do		if g ~= "n" and g ~= "n-p" and not allowed_genders[g] then error("Unrecognized gender: " .. g)		end if args.g_qual[i] then table.insert(data.genders, {spec = g, qualifiers = {args.g_qual[i]}}) else table.insert(data.genders, g)		end end

local function do_inflection(forms, quals, label) if #forms > 0 then local terms = process_terms_with_qualifiers(forms, quals) check_all_missing(terms, plpos, tracking_categories) terms.label = label table.insert(data.inflections, terms) end end

do_inflection(args.m, args.m_qual, "masculine") do_inflection(args.f, args.f_qual, "feminine") do_inflection(args.sg, args.sg_qual, "singular") do_inflection(args.pl, args.pl_qual, "plural") do_inflection(args.mpl, args.mpl_qual, "masculine plural") do_inflection(args.fpl, args.fpl_qual, "feminine plural") do_inflection(args.n, args.n_qual, "neuter") end

local function get_pronoun_params local params = { [1] = {list = "g"}, --gender(s) ["g_qual"] = {list = "g=_qual", allow_holes = true}, ["m"] = {list = true}, --masculine form(s) ["m_qual"] = {list = "m=_qual", allow_holes = true}, ["f"] = {list = true}, --feminine form(s) ["f_qual"] = {list = "f=_qual", allow_holes = true}, ["sg"] = {list = true}, --singular form(s) ["sg_qual"] = {list = "sg=_qual", allow_holes = true}, ["pl"] = {list = true}, --plural form(s) ["pl_qual"] = {list = "pl=_qual", allow_holes = true}, ["mpl"] = {list = true}, --masculine plural form(s) ["mpl_qual"] = {list = "mpl=_qual", allow_holes = true}, ["fpl"] = {list = true}, --feminine plural form(s) ["fpl_qual"] = {list = "fpl=_qual", allow_holes = true}, ["n"] = {list = true}, --neuter form(s) ["n_qual"] = {list = "n=_qual", allow_holes = true}, }	return params end

pos_functions["pronouns"] = { params = get_pronoun_params, func = function(args, data, tracking_categories, frame, is_suffix) do_pronoun(args, data, tracking_categories, "pronoun", is_suffix) end, }

- --                                      Adjectives                                    -- -

local function insert_ancillary_inflection(data, forms, quals, label, plpos, tracking_categories) if forms and #forms > 0 then local terms = process_terms_with_qualifiers(forms, quals) check_all_missing(terms, plpos, tracking_categories) terms.label = label table.insert(data.inflections, terms) end end

-- Handle comparatives and superlatives for adjectives and adverbs, including user-specified comparatives and -- superlatives, default-requested comparatives/superlatives using '+', autogenerated comparatives/superlatives, -- and hascomp=. Code is the same for adjectives and adverbs. local function handle_adj_adv_comp(args, data, plpos, is_adv, tracking_categories) local lemma = m_links.remove_links(data.heads[1]) -- should always be specified local stem

if is_adv then stem = com.rsub(lemma, "mente$", "") else stem = lemma end

local function make_absolute_superlative(special) if is_adv then return com.make_adverbial_absolute_superlative(stem, special) else return com.make_absolute_superlative(stem, special) end end

-- Maybe autogenerate default comparative/superlative. if args.comp and args.sup then-- comp= and sup= were given as options to the user -- If no comp, but a non-default sup given, then add the default comparative/superlative. -- This is useful when an absolute superlative is given. local saw_sup_plus = false if #args.comp == 0 and #args.sup > 0 then for i, supval in ipairs(args.sup) do				if supval == "+" then saw_sup_plus = true end end if not saw_sup_plus then args.comp = {"+"} table.insert(args.sup, 1, "+") end end

-- If comp=+, use default comparative 'mais ...', and set a default superlative if unspecified. local saw_comp_plus = false for i, compval in ipairs(args.comp) do			if compval == "+" then saw_comp_plus = true args.comp[i] = "mais " .. lemma .. "" end end if saw_comp_plus and #args.sup == 0 then args.sup = {"+"} end -- If sup=+ (possibly from comp=+), use default superlative 'o mais ...'. Also handle absolute superlatives. for i, supval in ipairs(args.sup) do			if supval == "+" then args.sup[i] = "o mais " .. lemma .. "" elseif supval == "+abs" then args.sup[i] = make_absolute_superlative elseif rfind(supval, "^%+abs:") then local sp = rmatch(supval, "^%+abs:(.*)$") args.sup[i] = make_absolute_superlative(sp) end end end

if args.hascomp then if args.hascomp == "both" then table.insert(data.inflections, {label = "sometimes " .. glossary_link("comparable")}) table.insert(data.categories, langname .. " comparable " .. plpos) table.insert(data.categories, langname .. " uncomparable " .. plpos) else local hascomp = require("Module:yesno")(args.hascomp) if hascomp == true then table.insert(data.inflections, {label = glossary_link("comparable")}) table.insert(data.categories, langname .. " comparable " .. plpos) elseif hascomp == false then table.insert(data.inflections, {label = "not " .. glossary_link("comparable")}) table.insert(data.categories, langname .. " uncomparable " .. plpos) else error("Unrecognized value for hascomp=: " .. args.hascomp) end end elseif args.comp and #args.comp > 0 or args.sup and #args.sup > 0 then table.insert(data.inflections, {label = glossary_link("comparable")}) table.insert(data.categories, langname .. " comparable " .. plpos) end

insert_ancillary_inflection(data, args.comp, args.comp_qual, "comparative", plpos, tracking_categories) insert_ancillary_inflection(data, args.sup, args.sup_qual, "superlative", plpos, tracking_categories) end

local function do_adjective(args, data, tracking_categories, pos, is_suffix, is_superlative) local feminines = {} local masculine_plurals = {} local feminine_plurals = {} if is_suffix then pos = "suffix" end local plpos = require("Module:string utilities").pluralize(pos)

if not is_suffix then data.pos_category = plpos end

if args.sp then local romut = require(romut_module) if not romut.allowed_special_indicators[args.sp] then local indicators = {} for indic, _ in pairs(romut.allowed_special_indicators) do table.insert(indicators, "'" .. indic .. "'") end table.sort(indicators) error("Special inflection indicator beginning can only be " ..				m_table.serialCommaJoin(indicators, {dontTag = true}) .. ": " .. args.sp) end end

local lemma = m_links.remove_links(data.heads[1]) -- should always be specified

local function insert_inflection(forms, label, accel) if #forms > 0 then if forms[1].term == "-" then table.insert(data.inflections, {label = "no " .. label}) else forms.label = label forms.accel = {form = accel} table.insert(data.inflections, forms) end end end

if args.short then table.insert(data.inflections, {label = "short participle"}) end

if args.inv then -- invariable adjective table.insert(data.inflections, {label = glossary_link("invariable")}) table.insert(data.categories, langname .. " indeclinable " .. plpos) if args.sp or #args.f > 0 or #args.pl > 0 or #args.mpl > 0 or #args.fpl > 0 then error("Can't specify inflections with an invariable " .. pos) end elseif args.fonly then -- feminine-only if #args.f > 0 then error("Can't specify explicit feminines with feminine-only " .. pos) end if #args.pl > 0 then error("Can't specify explicit plurals with feminine-only " .. pos .. ", use fpl=") end if #args.mpl > 0 then error("Can't specify explicit masculine plurals with feminine-only " .. pos) end local argsfpl = args.fpl if #argsfpl == 0 then argsfpl = {"+"} end for i, fpl in ipairs(argsfpl) do			if fpl == "+" then local defpl = com.make_plural(lemma, args.sp) if not defpl then error("Unable to generate default plural of '" .. lemma .. "'") end fpl = defpl else fpl = replace_hash_with_lemma(fpl, lemma) end table.insert(feminine_plurals, {term = fpl, q = fetch_qualifiers(args.fpl_qual[i])}) end

check_all_missing(feminine_plurals, plpos, tracking_categories)

table.insert(data.inflections, {label = "feminine-only"}) insert_inflection(feminine_plurals, "feminine plural", "f|p") else -- Gather feminines. local argsf = args.f		if #argsf == 0 then argsf = {"+"} end for i, f in ipairs(argsf) do			if f == "+" then -- Generate default feminine. f = com.make_feminine(lemma, args.sp) else f = replace_hash_with_lemma(f, lemma) end table.insert(feminines, {term = f, q = fetch_qualifiers(args.f_qual[i])}) end

local argsmpl = args.mpl local argsfpl = args.fpl if #args.pl > 0 then if #argsmpl > 0 or #argsfpl > 0 or args.mpl_qual.maxindex > 0 or args.fpl_qual.maxindex > 0 then error("Can't specify both pl= and mpl=/fpl=") end argsmpl = args.pl			args.mpl_qual = args.pl_qual argsfpl = args.pl			args.fpl_qual = args.pl_qual end if #argsmpl == 0 then argsmpl = {"+"} end if #argsfpl == 0 then argsfpl = {"+"} end

for i, mpl in ipairs(argsmpl) do			if mpl == "+" then -- Generate default masculine plural. local defpl = com.make_plural(lemma, args.sp) if not defpl then error("Unable to generate default plural of '" .. lemma .. "'") end mpl = defpl else mpl = replace_hash_with_lemma(mpl, lemma) end table.insert(masculine_plurals, {term = mpl, q = fetch_qualifiers(args.mpl_qual[i])}) end

for i, fpl in ipairs(argsfpl) do			if fpl == "+" then for _, f in ipairs(feminines) do -- Generate default feminine plural; f is a table. local defpl = com.make_plural(f.term, args.sp) if not defpl then error("Unable to generate default plural of '" .. f.term .. "'") end table.insert(feminine_plurals, {term = defpl, q = fetch_qualifiers(args.fpl_qual[i], f.q)}) end else fpl = replace_hash_with_lemma(fpl, lemma) table.insert(feminine_plurals, {term = fpl, q = fetch_qualifiers(args.fpl_qual[i])}) end end

check_all_missing(feminines, plpos, tracking_categories) check_all_missing(masculine_plurals, plpos, tracking_categories) check_all_missing(feminine_plurals, plpos, tracking_categories)

local fem_like_lemma = #feminines == 1 and feminines[1].term == lemma and not feminines[1].q		local fem_pl_like_masc_pl = #masculine_plurals > 0 and #feminine_plurals > 0 and m_table.deepEquals(masculine_plurals, feminine_plurals) local masc_pl_like_lemma = #masculine_plurals == 1 and masculine_plurals[1].term == lemma and not masculine_plurals[1].q		if fem_like_lemma and fem_pl_like_masc_pl and masc_pl_like_lemma then -- actually invariable table.insert(data.inflections, {label = glossary_link("invariable")}) table.insert(data.categories, langname .. " indeclinable " .. plpos) else -- Make sure there are feminines given and not same as lemma. if not fem_like_lemma then insert_inflection(feminines, "feminine", "f|s") end

if fem_pl_like_masc_pl then insert_inflection(masculine_plurals, "plural", "p") data.genders = {"mf"} else insert_inflection(masculine_plurals, "masculine plural", "m|p") insert_inflection(feminine_plurals, "feminine plural", "f|p") end end end

insert_ancillary_inflection(data, args.n, args.n_qual, "neuter", plpos, tracking_categories)

handle_adj_adv_comp(args, data, plpos, false, tracking_categories)

-- Handle requests for default diminutive. if args.dim then for i, dim in ipairs(args.dim) do			if dim == "+" then args.dim[i] = com.make_diminutive(lemma) elseif dim:find("^%+") then dim = require(romut_module).get_special_indicator(dim) args.dim[i] = com.make_diminutive(lemma, dim) end end end

-- Handle requests for default augmentative. if args.aug then for i, aug in ipairs(args.aug) do			if aug == "+" then args.aug[i] = com.make_augmentative(lemma) elseif aug:find("^%+") then aug = require(romut_module).get_special_indicator(aug) args.aug[i] = com.make_augmentative(lemma, aug) end end end

insert_ancillary_inflection(data, args.dim, args.dim_qual, "diminutive", plpos, tracking_categories) insert_ancillary_inflection(data, args.aug, args.aug_qual, "augmentative", plpos, tracking_categories)

if is_metaphonic(args, lemma) then table.insert(data.inflections, {label = metaphonic_label}) table.insert(data.categories, langname .. " " .. plpos .. " with metaphony") end

if args.irreg and is_superlative then table.insert(data.categories, langname .. " irregular superlative " .. plpos) end end

local function get_adjective_params(adjtype) local params = { ["inv"] = {type = "boolean"}, --invariable ["sp"] = {}, -- special indicator: "first", "first-last", etc.		["f"] = {list = true}, --feminine form(s) ["f_qual"] = {list = "f=_qual", allow_holes = true}, ["pl"] = {list = true}, --plural override(s) ["pl_qual"] = {list = "pl=_qual", allow_holes = true}, ["mpl"] = {list = true}, --masculine plural override(s) ["mpl_qual"] = {list = "mpl=_qual", allow_holes = true}, ["fpl"] = {list = true}, --feminine plural override(s) ["fpl_qual"] = {list = "fpl=_qual", allow_holes = true}, ["meta"] = {type = "boolean"}, -- metaphonic ["nometa"] = {type = "boolean"}, -- explicitly not metaphonic }	if adjtype == "base" then params["comp"] = {list = true} --comparative(s) params["comp_qual"] = {list = "comp=_qual", allow_holes = true} params["sup"] = {list = true} --superlative(s) params["sup_qual"] = {list = "sup=_qual", allow_holes = true} params["dim"] = {list = true} --diminutive(s) params["dim_qual"] = {list = "dim=_qual", allow_holes = true} params["aug"] = {list = true} --augmentative(s) params["aug_qual"] = {list = "aug=_qual", allow_holes = true} params["fonly"] = {type = "boolean"} -- feminine only params["hascomp"] = {} -- has comparative end if adjtype == "part" then params["short"] = {type = "boolean"} -- short participle end if adjtype == "sup" then params["irreg"] = {type = "boolean"} end if adjtype == "pron" or adjtype == "contr" then params["n"] = {list = true} --neuter form(s) params["n_qual"] = {list = "n=_qual", allow_holes = true} end return params end

pos_functions["adjectives"] = { params = get_adjective_params("base"), func = function(args, data, tracking_categories, frame, is_suffix) do_adjective(args, data, tracking_categories, "adjective", is_suffix) end, }

pos_functions["comparative adjectives"] = { params = get_adjective_params("comp"), func = function(args, data, tracking_categories, frame, is_suffix) do_adjective(args, data, tracking_categories, "adjective", is_suffix) end, }

pos_functions["superlative adjectives"] = { params = get_adjective_params("sup"), func = function(args, data, tracking_categories, frame, is_suffix) do_adjective(args, data, tracking_categories, "adjective", is_suffix, "is superlative") end, }

pos_functions["past participles"] = { params = get_adjective_params("part"), func = function(args, data, tracking_categories, frame, is_suffix) do_adjective(args, data, tracking_categories, "participle", is_suffix) data.pos_category = "past participles" end, }

pos_functions["determiners"] = { params = get_adjective_params("det"), func = function(args, data, tracking_categories, frame, is_suffix) do_adjective(args, data, tracking_categories, "determiner", is_suffix) end, }

pos_functions["adjective-like pronouns"] = { params = get_adjective_params("pron"), func = function(args, data, tracking_categories, frame, is_suffix) do_adjective(args, data, tracking_categories, "pronoun", is_suffix) end, }

pos_functions["adjective-like contractions"] = { params = get_adjective_params("contr"), func = function(args, data, tracking_categories, frame, is_suffix) do_adjective(args, data, tracking_categories, "contraction", is_suffix) end, }

- --                                       Adverbs                                      -- -

local function do_adverb(args, data, tracking_categories, pos, is_suffix) if is_suffix then pos = "suffix" end local plpos = require("Module:string utilities").pluralize(pos)

if not is_suffix then data.pos_category = plpos end

handle_adj_adv_comp(args, data, plpos, "is adv", tracking_categories) end

local function get_adverb_params(advtype) local params = {} if advtype == "base" then params["comp"] = {list = true} --comparative(s) params["comp_qual"] = {list = "comp=_qual", allow_holes = true} params["sup"] = {list = true} --superlative(s) params["sup_qual"] = {list = "sup=_qual", allow_holes = true} params["hascomp"] = {} -- has comparative end return params end

pos_functions["adverbs"] = { params = get_adverb_params("base"), func = function(args, data, tracking_categories, frame, is_suffix) do_adverb(args, data, tracking_categories, "adverb", is_suffix) end, }

pos_functions["comparative adverbs"] = { params = get_adverb_params("comp"), func = function(args, data, tracking_categories, frame, is_suffix) do_adverb(args, data, tracking_categories, "adverb", is_suffix) end, }

pos_functions["superlative adverbs"] = { params = get_adverb_params("sup"), func = function(args, data, tracking_categories, frame, is_suffix) do_adverb(args, data, tracking_categories, "adverb", is_suffix) end, }

- --                                        Verbs                                       -- -

pos_functions["verbs"] = { params = { [1] = {},		["pres"] = {list = true}, --present ["pres_qual"] = {list = "pres=_qual", allow_holes = true}, ["pres3s"] = {list = true}, --third-singular present ["pres3s_qual"] = {list = "pres3s=_qual", allow_holes = true}, ["pret"] = {list = true}, --preterite ["pret_qual"] = {list = "pret=_qual", allow_holes = true}, ["part"] = {list = true}, --participle ["part_qual"] = {list = "part=_qual", allow_holes = true}, ["short_part"] = {list = true}, --short participle ["short_part_qual"] = {list = "short_part=_qual", allow_holes = true}, ["noautolinktext"] = {type = "boolean"}, ["noautolinkverb"] = {type = "boolean"}, ["attn"] = {type = "boolean"}, },	func = function(args, data, tracking_categories, frame) local preses, preses_3s, prets, parts, short_parts

if args.attn then table.insert(tracking_categories, "Requests for attention concerning " .. langname) return end

local pt_verb = require(pt_verb_module) local alternant_multiword_spec = pt_verb.do_generate_forms(args, "pt-verb", data.heads[1])

local specforms = alternant_multiword_spec.forms local function slot_exists(slot) return specforms[slot] and #specforms[slot] > 0 end

local function do_finite(slot_tense, label_tense) -- Use pres_3s if it exists and pres_1s doesn't exist (e.g. impersonal verbs); similarly for pres_3p (only3p verbs); -- but fall back to pres_1s if neither pres_1s nor pres_3s nor pres_3p exist (e.g. empedernir). local has_1s = slot_exists(slot_tense .. "_1s") local has_3s = slot_exists(slot_tense .. "_3s") local has_3p = slot_exists(slot_tense .. "_3p") if has_1s or (not has_3s and not has_3p) then return { slot = slot_tense .. "_1s", label = ("first-person singular %s"):format(label_tense), }, true elseif has_3s then return { slot = slot_tense .. "_3s", label = ("third-person singular %s"):format(label_tense), }, false else return { slot = slot_tense .. "_3p", label = ("third-person plural %s"):format(label_tense), }, false end end

local did_pres_1s preses, did_pres_1s = do_finite("pres", "present") preses_3s = { slot = "pres_3s", label = "third-person singular present", }		prets = do_finite("pret", "preterite") parts = { slot = "pp_ms", label = "past participle", }		short_parts = { slot = "short_pp_ms", label = "short past participle", }

if #args.pres > 0 or #args.pres3s > 0 or #args.pret > 0 or #args.part > 0 or #args.short_part > 0 then track("verb-old-multiarg") end

local function strip_brackets(qualifiers) if not qualifiers then return nil end local stripped_qualifiers = {} for _, qualifier in ipairs(qualifiers) do				local stripped_qualifier = qualifier:match("^%[(.*)%]$") if not stripped_qualifier then error("Internal error: Qualifier should be surrounded by brackets at this stage: " .. qualifier) end table.insert(stripped_qualifiers, stripped_qualifier) end return stripped_qualifiers end

local function do_verb_form(args, qualifiers, slot_desc, skip_if_empty) local forms local to_insert

if #args == 0 then forms = specforms[slot_desc.slot] if not forms or #forms == 0 then if skip_if_empty then return end forms = end elseif #args == 1 and args[1] == "-" then forms = else forms = {} for i, arg in ipairs(args) do					local qual = qualifiers[i] if qual then -- FIXME: It's annoying we have to add brackets and strip them out later. The inflection -- code adds all footnotes with brackets around them; we should change this. qual = {"[" .. qual .. "]"}					end local form = arg if not args.noautolinkverb then form = com.add_links(form) end table.insert(forms, {form = form, footnotes = qual}) end end

if forms[1].form == "-" then to_insert = {label = "no " .. slot_desc.label} else local into_table = {label = slot_desc.label} for _, form in ipairs(forms) do					local qualifiers = strip_brackets(form.footnotes) -- Strip redundant brackets surrounding entire form. These may get generated e.g. -- if we use the angle bracket notation with a single word. local stripped_form = rmatch(form.form, "^%[%[([^%[%]]*)%]%]$") or form.form stripped_form = pt_verb.remove_variant_codes(stripped_form) -- Don't include accelerators if brackets remain in form, as the result will be wrong. -- FIXME: For now, don't include accelerators. We should use the new once implemented. -- local this_accel = not stripped_form:find("%[%[") and accel or nil local this_accel = nil table.insert(into_table, {term = stripped_form, q = qualifiers, accel = this_accel}) end to_insert = into_table end

table.insert(data.inflections, to_insert) end

local skip_pres_if_empty if alternant_multiword_spec.no_pres1_and_sub then table.insert(data.inflections, {label = "no first-person singular present"}) table.insert(data.inflections, {label = "no present subjunctive"}) end if alternant_multiword_spec.no_pres_stressed then table.insert(data.inflections, {label = "no stressed present indicative or subjunctive"}) skip_pres_if_empty = true end if alternant_multiword_spec.only3s then table.insert(data.inflections, {label = glossary_link("impersonal")}) elseif alternant_multiword_spec.only3sp then table.insert(data.inflections, {label = "third-person only"}) elseif alternant_multiword_spec.only3p then table.insert(data.inflections, {label = "third-person plural only"}) end local has_vowel_alt if alternant_multiword_spec.vowel_alt then for _, vowel_alt in ipairs(alternant_multiword_spec.vowel_alt) do				if vowel_alt ~= "+" and vowel_alt ~= "í" and vowel_alt ~= "ú" then has_vowel_alt = true break end end end

local function expand_footnotes_and_references(footnotes) if not footnotes then return nil end return require("Module:inflection utilities").fetch_headword_qualifiers_and_references(footnotes) end

do_verb_form(args.pres, args.pres_qual, preses, skip_pres_if_empty) -- We want to include both the pres_1s and pres_3s if there is a vowel alternation in the present singular. But we -- don't want to redundantly include the pres_3s if we already included it. if did_pres_1s and has_vowel_alt then do_verb_form(args.pres3s, args.pres3s_qual, preses_3s, skip_pres_if_empty) end do_verb_form(args.pret, args.pret_qual, prets) do_verb_form(args.part, args.part_qual, parts) do_verb_form(args.short_part, args.short_part_qual, short_parts, "skip if empty")

-- Add categories. for _, cat in ipairs(alternant_multiword_spec.categories) do			table.insert(data.categories, cat) end

-- If the user didn't explicitly specify head=, or specified exactly one head (not 2+) and we were able to		-- incorporate any links in that head into the 1= specification, use the infinitive generated by -- Module:pt-verb in place of the user-specified or auto-generated head. This was copied from -- Module:it-headword, where doing this gets accents marked on the verb(s). We don't have accents marked on -- the verb but by doing this we do get any footnotes on the infinitive propagated here. Don't do this if the -- user gave multiple heads or gave a head with a multiword-linked verbal expression such as Italian -- 'dare esca al fuoco' (FIXME: give Portuguese equivalent). if #data.user_specified_heads == 0 or (			#data.user_specified_heads == 1 and alternant_multiword_spec.incorporated_headword_head_into_lemma		) then data.heads = {} for _, lemma_obj in ipairs(alternant_multiword_spec.forms.infinitive_linked) do				local quals, refs = expand_footnotes_and_references(lemma_obj.footnotes) table.insert(data.heads, {term = lemma_obj.form, q = quals, refs = refs}) end end end }

- --                                   Suffix forms                                     -- -

pos_functions["suffix forms"] = { params = { [1] = {required = true, list = true}, ["g"] = {list = true}, ["g_qual"] = {list = "g=_qual", allow_holes = true}, },	func = function(args, data, is_suffix) data.genders = {} process_genders(data, args.g, args.g_qual) local suffix_type = {} for _, typ in ipairs(args[1]) do table.insert(suffix_type, typ .. "-forming suffix") end table.insert(data.inflections, {label = "non-lemma form of " .. m_table.serialCommaJoin(suffix_type, {conj = "or"})}) end, }

return export

title: Module:User:Benwing2/pt-headword


text:
choc pétrolier

Noun

 * 1) oil crisis, oil shock

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

title: choc pétrolier


text:
tukã

Etymology
From, from , from.

Noun

 * 1) toucan

title: tukã


text: カビ

title: カビ


title: User:Benwing2/pt-adj


text:
дегтр

Noun

 * 1) book

title: дегтр


text: обміняв

title: обміняв


text:
tykua

Verb

 * 1) to sweeten a drink

title: tykua


text:
typeia

Noun

 * 1) broom

title: typeia


text: ꙏ

title: ꙏ


text: Ꙏ

title: Ꙏ


text: Courcelles-le-Comte

title: Courcelles-le-Comte


text:
ноһан

Etymology
From, compare 🇨🇬, 🇨🇬.

Noun

 * 1) greens; grass

Adjective

 * 1) green

title: ноһан


text:
osmidig

Etymology
From.

Adjective

 * 1)  clumsy (physically or otherwise)
 * 2) clumsy, ungainly, difficult to work with
 * 3) not flexible, pliable, or malleable (of for example a dough or metal)
 * 1) clumsy, ungainly, difficult to work with
 * 2) not flexible, pliable, or malleable (of for example a dough or metal)
 * 1) not flexible, pliable, or malleable (of for example a dough or metal)
 * 1) not flexible, pliable, or malleable (of for example a dough or metal)

title: osmidig


text: Template:RQ:Ford Man

title: Template:RQ:Ford Man


text:
дулан

Adjective

 * 1) warm

title: дулан


text:
youse's

Determiner

 * 1)  Possessive of youse (standing in for your).

Pronoun

 * 1)  Possessive of youse (standing in for yours).
 * This drink’s mine; Bill and Joe, those drinks are youse’s.

title: youse's


text: Rœux

title: Rœux


text:
Template:RQ:Ford Man/documentation

Usage
This template may be used on Wiktionary entry pages to quote 's work  (1st American edition, 1926); the 1st edition published in the same year (London: Duckworth, 1926; ) is not currently available online. The template can be used to create a link to an online version of the work at the Internet Archive.

Parameters
The template takes the following parameters:

Examples

 * Wikitext:
 * ; or
 * Result:
 * Result:

title: Template:RQ:Ford Man/documentation


text: Citations:Qibin

title: Citations:Qibin


text:
Handout

Etymology
.

Noun

 * 1) handout worksheet, leaflet, or pamphlet

title: Handout


text:
дольган

Etymology
From, compare 🇨🇬, 🇨🇬.

Noun

 * 1) wave

title: дольган


text:
द्विष्

Etymology
From from. Cognate with 🇨🇬 whence 🇨🇬, 🇨🇬 whence 🇨🇬.

Root

 * 1) to hate, show hatred
 * 2) to be hostile or unfriendly
 * 3) to be a rival

title: द्विष्


title: User:Benwing2/test-pt-adj


text:
зузан

Etymology
From. Cognate with 🇨🇬.

Noun

 * 1) thick

title: зузан


text: Category:ota:Female animals

title: Category:ota:Female animals


text: manit

title: manit


text:
розбудовувати

Etymology
From the stem of. Compare 🇨🇬, 🇨🇬.

Verb

 * 1) to build up, to develop, to expand
 * 2) to rebuild

title: розбудовувати


text: zamke

title: zamke


text: ꙃ

title: ꙃ


text:
розбудувати

Etymology
From. Compare 🇨🇬, 🇨🇬.

Verb

 * 1) to build up, to develop, to expand
 * 2) to rebuild

title: розбудувати


text: zamci

title: zamci


text: zamca

title: zamca


text: zamko

title: zamko


text: zamkom

title: zamkom


text: ghlic

title: ghlic


text:
upi'a

Noun

 * 1) egg

title: upi'a


text: Vitry-en-Artois

title: Vitry-en-Artois


text: Template:RQ:Orczy Son of the People

title: Template:RQ:Orczy Son of the People


text: zamče

title: zamče


text: dvorci

title: dvorci


text: ꙁ

title: ꙁ


text:
كنند

Etymology
From.

Noun

 * 1) hoe, an agricultural tool used for digging rows
 * 2) hoe or mattock with two teeth, two-pronged mattock
 * 1) hoe or mattock with two teeth, two-pronged mattock

title: كنند


text: dvorče

title: dvorče


text: dvorce

title: dvorce


text: dvorcu

title: dvorcu


text: dvorca

title: dvorca


text: dvorcem

title: dvorcem


text:
долан

Etymology
From, compare 🇨🇬, 🇨🇬.

Numeral

 * 1) seven

title: долан


text: ghníomh

title: ghníomh


text: dvorců

title: dvorců


text:
бичкн

Etymology
From, compare 🇨🇬.

Adjective

 * 1) small

title: бичкн


text: Qíbīn

title: Qíbīn


text:
Template:RQ:Orczy Son of the People/documentation

Usage
This template may be used on Wiktionary entry pages to quote Baroness Orczy's work  (1st edition, 1906). It can be used to create a link to an online version of the work at the HathiTrust Digital Library.

Parameters
The template takes the following parameters:

Examples

 * Wikitext:
 * ; or
 * Result:
 * Result:


text: Citations:beithir

title: Citations:beithir


text:
kamphund

Etymology
From.

Noun

 * 1) an attack dog used in dogfighting
 * 2)  a dog of a breed historically used in dogfighting (or with admixture of such breeds), like a pit bull terrier

Usage notes
Sometimes more generally about dogs thought to be scary.

title: kamphund


text: zamkach

title: zamkach


text: zamkami

title: zamkami


text: Leforest

title: Leforest


text:
һуйр

Etymology
From, compare 🇨🇬, 🇨🇬, 🇨🇬.

Noun

 * 1) flour
 * 2) dough, batter

title: һуйр


text:
tenkit

Etymology 1
, from.

Noun

 * 1)  criticism

Etymology 2
, from.

Noun

 * 1)  punctuation

title: tenkit


text: wrengthe

title: wrengthe


text:
вӣвв

Etymology
From.

Noun

 * 1)  son-in-law

title: вӣвв


text:
eleştiri

Etymology
From.

Noun

 * 1) criticism

title: eleştiri


text:
зя̄һтҍ

Etymology
From.

Noun

 * 1)  son-in-law

title: зя̄һтҍ


text:
обмінювати

Verb

 * 1)  to exchange

title: обмінювати


text:
User:Gustavo H. Scherer

Gustavo H. Scherer (aka. Rainbs) is a polyglot and linguistics enthusiast born in October 7th, 2001 in Caxias do Sul, Brazil and is now living in Trondheim, Norway. He is currently developing a conlang called "Reĭnsk", a germanic language made as a personal project for future generations, used as a heritage language.

title: User:Gustavo H. Scherer


text:
大肥豬

Noun

 * 1)  fat person; fatty; fatso

title: 大肥豬


text: 大肥猪

title: 大肥猪


text: ꙉ

title: ꙉ


text: Category:zle-ono:Mechanisms

title: Category:zle-ono:Mechanisms


text: Category:zle-ono:Technology

title: Category:zle-ono:Technology


text: Category:zle-ono:Machines

title: Category:zle-ono:Machines


text: обмінюваний

title: обмінюваний


text: Libercourt

title: Libercourt


text:
ча̄пэх

Etymology
From.

Noun

 * 1)  neck

title: ча̄пэх


text:
kapitał akcyjny

Etymology
lit. 'stock/share capital'.

Noun

 * 1)  share capital, capital stock, nominal capital, equity

title: kapitał akcyjny


text: Category:sla-pro:Mechanisms

title: Category:sla-pro:Mechanisms


text:
ча̄пат

Etymology
From.

Noun

 * 1)  neck

title: ча̄пат


title: Template:R:xcl:Ačaṙean:1944


text:
Module talk:pt-headword

Rewriting this module
I am in the process of rewriting this module and changing the format of pt-adj (to start with) to be smarter and more automatic and work like es-adj. The idea is that most adjectives need no parameters at all, and those that do have flexible parameters with sensible defaults. See User:Benwing2/test-pt-adj for examples. One thing I notice is that currently pt-adj has a comp parameter (comparable) that defaults to. This has clearly failed in that e.g. saudita and massai and vinícola and even misérrimo are listed as comparable because whoever created them didn't bother to add no. I am planning on changing this so that comp has no default, and you have to explicitly specify,   or   (= comparable and uncomparable) to get something in the headword indicating comparable status; otherwise nothing is displayed. Existing adjectives that explicitly specify a value for comp will keep it, but otherwise there won't be a default. (Also, superlative adjectives like misérrimo won't even support this parameter.) The alternative is to have no comp param at all, the same as es-adj.

Also, I am suspicious of pt-adj-infl and I believe it should probably be deleted and removed from all pages it currently exists on. No other Romance language outside of Romanian (which has adjectival case and definiteness) feels the need to have a declension table for adjectives; the headword should be sufficient. Furthermore, I suspect a lot of the info in these tables is wrong; e.g. claims to have an augmentative folhadão and diminutive folhadinho. These terms certainly exist but appear to be nouns; I can't attest e.g. feminine augmentative folhadona.

Thoughts? Benwing2 (talk) 19:57, 5 September 2022 (UTC)

 * I greatly welcome all the changes. I would just like to ask for some optional parameters to add alternative plurals and feminine forms and their respective qualifiers. - Sarilho1 (talk) 20:21, 5 September 2022 (UTC)
 * Yup, all this is present, see User:Benwing2/test-pt-adj for examples. Benwing2 (talk) 20:58, 5 September 2022 (UTC)
 * Looks great! - Sarilho1 (talk) 21:14, 5 September 2022 (UTC)
 * That's great. Could one of our talented programmers also do automatic hyphenation for Portuguese? If you guys are able to program the automation of much more complex things such as pronunciation and grammar, I guess hyphenation should be easy peasy. - Munmula (talk) 21:09, 5 September 2022 (UTC)
 * This will happen in time. I have already done automatic hyphenation for Spanish and Italian. Benwing2 (talk) 22:06, 5 September 2022 (UTC)
 * If I'm not mistaken, the rules are basically the same as Spanish, the only difference I remember being double Rs splitting in Portuguese but not Spanish (example: barra is bar-ra in Portuguese and ba-rra in Spanish). - Munmula (talk) 22:16, 5 September 2022 (UTC)

title: Module talk:pt-headword


text: plurigeniche

title: plurigeniche


text: plurigenici

title: plurigenici


text:
үзг

Noun

 * 1) side; direction
 * ар үзг
 * ar yzg
 * The North
 * 1) letter a symbol in an alphabet; writing, script
 * тод үзг
 * tod yzg
 * The Clear Script

title: үзг


text:
че̄дза

Etymology
From.

Noun

 * 1)  maternal uncle

title: че̄дза


text:
xondáro

Noun

 * 1) soldier
 * 2) guardian

title: xondáro


text:
bläckplump

Etymology
From.

Noun

 * 1) a blot of ink; an inkblot

title: bläckplump


text:
Talk:Wim

Audio pronunciation incorrect; lacking accurate pronunciation information
Can this entry be improved as regards the Dutch pronunciation of this name? In the audio we hear it pronounced as "Vim," which is wrong (the "W" in the Dutch name Wim should be pronounced as in English "wind"), and there is no guide to the actual pronunciation of this name, in IPA or otherwise, just a mention of which vowel it rhymes with. Thank you for this attention. 173.88.246.138 20:08, 5 September 2022 (UTC)

title: Talk:Wim


title: Template:R:xcl:Abuladze:1944b


text:
ча̄рр

Etymology
From. Cognates include 🇨🇬 and 🇨🇬.

Noun

 * 1)  tundra

title: ча̄рр


title: Template:R:xcl:Abuladze:1944c


text:
धम्

Etymology
From. Cognate with 🇨🇬, 🇨🇬, 🇨🇬.

Root

 * 1) to blow, blow into
 * 2) to breathe out, exhale
 * 3) to kindle a fire by blowing
 * 4) to melt or manufacture (metal) by blowing
 * 5) to blow or cast away

title: धम्


text:
девтр

Noun

 * 1) notebook; exercise book

title: девтр


text:
آوخ

Interjection

 * 1) ah! alas!

title: آوخ


text: Seclin

title: Seclin


text:
че̄д

Etymology
From. Cognates include 🇨🇬, 🇨🇬 and 🇨🇬.

Adverb

 * 1) through
 * 2) throughout a time period
 * 3) throughout, completely

Ambiposition

 * 1) through

title: че̄д


text:
zanka

Etymology
,.

Noun

 * 1) snare
 * 2) mesh

title: zanka


text:
توی

Etymology

 * cognate with 🇨🇬, 🇨🇬, 🇨🇬, 🇨🇬, 🇨🇬, 🇨🇬, 🇨🇬, 🇨🇬 and 🇨🇬.

Noun

 * 1) body hair, the hair of the body as opposed to facial hair and headhair
 * 2) feather, a branching, hair-like structure that grows on the bodies of birds
 * 3) down, the soft, fluffy, immature feathers which grow on young birds
 * 4) quill, the lower shaft of a feather, specifically the region lacking barbs

title: توی


text:
че̄ххч

Etymology
From, from. Cognates include 🇨🇬 and 🇨🇬, 🇨🇬, 🇨🇬 and 🇨🇬, 🇨🇬 and 🇨🇬.

Noun

 * 1)  autumn

title: че̄ххч


title: Template:R:xcl:Ačaṙean:1948


text:
kohvi

Etymology
Borrowed from. More distantly related to 🇨🇬.

Noun

 * 1) coffee

title: kohvi


text:
توي

Etymology
From. Cognates with 🇨🇬.

Noun

 * 1) wedding
 * 2) a happy event, ceremony, commemoration

title: توي


text:
відбудовувати

Etymology
From the stem of. Compare 🇨🇬, 🇨🇬.

Verb

 * 1)  to rebuild, to reconstruct, to restore

title: відбудовувати


text: Category:Kildin Sami terms derived from substrate languages


text:
sььra

Etymology
Borrowed from.

Noun

 * 1) cheese

title: sььra


text:
че̄вьресь

Etymology
From, likely of origin. Possibly related to 🇨🇬.

Noun

 * 1) otter

title: че̄вьресь


text:
відбудувати

Etymology
From. Compare 🇨🇬, 🇨🇬.

Verb

 * 1)  to rebuild, to reconstruct, to restore

title: відбудувати


text: batleth

title: batleth


text: batleths

title: batleths


text: அங்கூசம்

title: அங்கூசம்


text:
ӑйӑр

Etymology
.

Noun

 * 1) stallion

title: ӑйӑр


text:
tregoa

Etymology
From (13th century, ), probably from, inflected form of ; but attested  points perhaps to a West Germanic , from.

Noun

 * 1) truce

title: tregoa


text:
koore

Etymology
Cognate with 🇨🇬.

Noun

 * 1) smetana, crème fraîche

title: koore


text: Citations:case in point

title: Citations:case in point


text:
че̄гар

Etymology
From.

Noun

 * 1)  tendon, sinew

title: че̄гар


text: koorre

title: koorre


text:
धृष्

Etymology
From from an  extension of. Cognate with 🇨🇬, 🇨🇬 and 🇨🇬.

Root

 * 1) to dare
 * 2) to be bold, courageous or confident

title: धृष्


text:
ýagmyr

Etymology
From. Cognate with 🇨🇬.

Noun

 * 1) rain

title: ýagmyr


text:
poligènic

Etymology
From.

Adjective

 * 1)  polygenic

title: poligènic


text: poligènica

title: poligènica


text:
ýagyn

Etymology
From. Cognate with 🇨🇬, 🇨🇬.

Noun

 * 1) rain

title: ýagyn


text: poligèniques

title: poligèniques


text: poligènics

title: poligènics


text:
чаб

Etymology
From.

Adjective

 * 1) intact, whole, undamaged

title: чаб


text:
Module:category tree/poscatboiler/data/lang-specific/tl

local labels = {} local handlers = {}

labels["surnames in the Catálogo alfabético de apellidos"] = { description = " surnames listed at the .", additional = "To add a surname to this category, add tl to a surname entry's Etymology section.", parents = , }

labels["terms with Baybayin script"] = { description = " terms with inclusion of Baybayin script.", parents = , can_be_empty = true }

labels["terms without Baybayin script"] = { description = " terms without Baybayin script set.", parents = {"entry maintenance"}, hidden = true, can_be_empty = true }

labels["terms with missing Baybayin script entries"] = { description = " terms with missing Baybayin script entries.", parents = {"entry maintenance"}, hidden = true, can_be_empty = true }

labels["terms without pronunciation template"] = { description = " terms without either Template:tl-pr or Template:tl-IPA to indicate pronunciation.", parents = , hidden = true, can_be_empty = true }

labels["terms where syllabification alignment failed"] = { description = " terms where Module:tl-pronunciation was unable to align the syllabified respelling with the pagename to produce a syllabified spelling.", parents = , hidden = true, can_be_empty = true }

--- Pronunciation --

labels["terms with malumay pronunciation"] = { description = " terms with slow and gentle pronunciation characterized by penultimate stress.", parents = {"terms by phonemic property"}, can_be_empty = true }

labels["terms with malumi pronunciation"] = { description = " terms with slow and gentle pronunciation characterized by penultimate stress but glottalized.", parents = {"terms by phonemic property"}, can_be_empty = true }

labels["terms with mabilis pronunciation"] = { description = " terms with quick pronunciation characterized by ultimate stress.", parents = {"terms by phonemic property"}, can_be_empty = true }

labels["terms with maragsa pronunciation"] = { description = " terms with a forceful pronunciation characterized by ultimate stress but glottalized.", parents = {"terms by phonemic property"}, can_be_empty = true }

-- Superseded forms --

table.insert(handlers, function(data)	local year = data.label:match("^pre%-(.+) forms$")	if year then		return {			parents = ,		}	end end)

--- Verbs --

local verb_types = { ["1st actor trigger"] = { desc = "prefixed with or infixed with ", cat = {"terms prefixed with um-", "terms infixed with -um-"}, },	["2nd actor trigger"] = { desc = "prefixed with ", },	["3rd actor trigger"] = { desc = "prefixed with, which assimilates to before alveolar consonants and  before labial consonants; or sometimes prefixed with ", cat = {"terms prefixed with mang-"}, },	["4th actor trigger"] = { desc = "prefixed with ", },	["5th actor trigger"] = { desc = "prefixed with ", },	["6th actor trigger"] = { desc = "prefixed with ", },	["7th actor trigger"] = { desc = "prefixed with ", },	["8th actor trigger"] = { desc = "prefixed with ", },	["indirect actor trigger"] = { desc = "prefixed with ", },	["1st secondary indirect actor trigger"] = { desc = "circumfixed with ", },	["2nd secondary indirect actor trigger"] = { desc = "circumfixed with ", },	["3rd secondary indirect actor trigger"] = { desc = "circumfixed with ", },	["1st object trigger"] = { desc = "suffixed with, , or ", cat = {"terms suffixed with -in", "terms suffixed with -hin", "terms suffixed with -nin", "terms suffixed with -rin"}, },	["2nd object trigger"] = { desc = "suffixed with ", },	["3rd object trigger"] = { desc = "prefixed with ", },	["4th object trigger"] = { desc = "prefixed with ", },	["5th object trigger"] = { desc = "circumfixed with ", },	["6th object trigger"] = { desc = "prefixed with ", },	["7th object trigger"] = { desc = "circumfixed with ", },	["8th object trigger"] = { desc = "circumfixed with ", },	["9th object trigger"] = { desc = "prefixed with ", },	["10th object trigger"] = { desc = "circumfixed with ", },	["11th object trigger"] = { desc = "circumfixed with ", },	["1st locative trigger"] = { desc = "circumfixed with ", },	["2nd locative trigger"] = { desc = "circumfixed with or ", cat = {"terms circumfixed with ma- -an", "terms circumfixed with ma- -han"}, },	-- FIXME! The following is not listed in the documentation for Template:tl-verb. ["4th locative trigger"] = { desc = "?", cat = {}, },	["1st benefactive trigger"] = { desc = "prefixed with ", },	["2nd benefactive trigger"] = { desc = "prefixed with ", },	["3rd benefactive trigger"] = { desc = "prefixed with ", },	["1st instrument trigger"] = { desc = "prefixed with ", },	["2nd instrument trigger"] = { desc = "prefixed with ", },	["1st reason trigger"] = { desc = "prefixed with ", },	["alternate 1st reason trigger"] = { desc = "prefixed with ", },	["2nd reason trigger"] = { desc = "prefixed with ", },	["alternate 2nd reason trigger"] = { desc = "prefixed with ", },	["3rd reason trigger"] = { desc = "prefixed with ", },	["alternate 3rd reason trigger"] = { desc = "prefixed with ", },	["4th reason trigger"] = { desc = "prefixed with ", },	["1st directional trigger"] = { desc = "suffixed with ", },	["2nd directional trigger"] = { desc = "suffixed with ", },	["3rd directional trigger"] = { desc = "circumfixed with ", },	["4th directional trigger"] = { desc = "prefixed with ", },	["5th directional trigger"] = { desc = "circumfixed with ", },	["6th directional trigger"] = { desc = "circumfixed with ", },	["7th directional trigger"] = { desc = "circumfixed with ", },	["reference trigger"] = { desc = "prefixed with ", },	["1st reciprocal trigger"] = { desc = "circumfixed with ", },	["2nd reciprocal trigger"] = { desc = "prefixed with ", }, }

for verb_type, props in pairs(verb_types) do	local parents = props.cat if not parents then parents = {"terms " .. props.desc:gsub("", "%1")} end local infl_sort_key = verb_type:gsub("^alternate ", ""):gsub("^[0-9]+[a-z]+ ", "") table.insert(parents, 1, {name = "verbs by inflection type", sort = infl_sort_key})

labels[verb_type .. " verbs"] = { description = (" %s verbs, %s."):format(verb_type, props.desc), parents = parents, breadcrumb = verb_type, } end

return {LABELS = labels, HANDLERS = handlers}


text:
beoncello

Etymology
From.

Noun

 * 1)  ; a boy who likes wine

title: beoncello


text:
Talk:善

Also "good at" (something)
In Chinese, can't this also mean "good at" (something)? 173.88.246.138 21:11, 5 September 2022 (UTC)

title: Talk:善


text:
vatruška

Etymology
Borrowed from. Cognates include 🇨🇬.

Noun

 * 1) vatrushka

title: vatruška


text: Category:Oromo terms derived from Cushitic languages


text: Category:Tagalog data modules

title: Category:Tagalog data modules


text: Category:Urdu terms derived from the Arabic root ح ل ق


text:
яһсн

Etymology
.

Adjective

 * 1) what a, such a
 * Пөө, яһсн сәәхн эдв!
 * Pöö, yaxsn sääxn edv!
 * Ah, what a nice thing!

title: яһсн


text:
ambehtsmiþ

Etymology
From.

Noun

 * 1) official smith or carpenter

title: ambehtsmiþ


text: Category:Saho terms derived from Cushitic languages


text:
ध्वंस्

Etymology
From, nasal-infixed form of , probably with influence from the possibly related term , with further semantic shift to mean destruction (perhaps as allusions to natural phenomena like volcanism or storms, which involve smoke and haze).

Root

 * 1) to fall to pieces or to dust, decay, be ruined, perish
 * 2) to be gone, vanish
 * 3) to scatter, cover

title: ध्वंस्


text: Category:izh:Cakes and pastries

title: Category:izh:Cakes and pastries


text:
пөө

Interjection

 * 1) ah, oh

title: пөө


text: Category:eo:Citrus subfamily plants

title: Category:eo:Citrus subfamily plants


text: Category:eo:Rue family plants

title: Category:eo:Rue family plants


text: Category:eo:Sapindales order plants

title: Category:eo:Sapindales order plants


text:
Księga Powtórzonego Prawa

Etymology
lit. 'Book of Repeated Law'.

Proper noun

 * 1) Deuteronomy

title: Księga Powtórzonego Prawa


text:
najznamienitszy

Etymology
From.

title: najznamienitszy


text:
znamienitszy

Etymology
From.

title: znamienitszy


text:
txay

Etymology
, from. Cognate with 🇨🇬, 🇨🇬.

Noun

 * 1) fish

title: txay


text:
ध्वन्

Etymology
From. Cognate with 🇨🇬.

Root

 * 1) to sound, roar, make a noise
 * 2) to mean, imply

title: ध्वन्


text:
radiator hose

Noun

 * 1)  A rubber hose of a large diameter which carries engine coolant between the engine and radiator, and then backs towards the water pump.
 * 2)   A large penis of a black man.

title: radiator hose


text:
beoncino

Etymology
From.

title: beoncino


text: radiator hoses

title: radiator hoses


text: q. v.

title: q. v.


text: qd.

title: qd.


text:
panda crossing

Noun

 * 1)  A type of signal-controlled pedestrian crossing used in the United Kingdom from 1962 to 1967.

title: panda crossing


text: panda crossings

title: panda crossings


text: pword

title: pword


text: Category:zh:Lobe-finned fishes

title: Category:zh:Lobe-finned fishes


text:
gürrüldi

Etymology
From. Cognate with 🇨🇬.

Noun

 * 1) noise

title: gürrüldi


text:
password salting

Noun

 * 1)  A technique employed to protect passwords stored in a database by attaching a string of 32 or more characters and then hashing them.

title: password salting


text: password saltings

title: password saltings


text: pwords

title: pwords