ویکی‌واژه fawiktionary https://fa.wiktionary.org/wiki/%D9%88%DB%8C%DA%A9%DB%8C%E2%80%8C%D9%88%D8%A7%DA%98%D9%87:%D8%B5%D9%81%D8%AD%D9%87%D9%94_%D8%A7%D8%B5%D9%84%DB%8C MediaWiki 1.39.0-wmf.25 case-sensitive مدیا ویژه بحث کاربر بحث کاربر ویکی‌واژه بحث ویکی‌واژه پرونده بحث پرونده مدیاویکی بحث مدیاویکی الگو بحث الگو راهنما بحث راهنما رده بحث رده پیوست بحث پیوست TimedText TimedText talk پودمان بحث پودمان ابزار بحث ابزار توضیحات ابزار بحث توضیحات ابزار sex 0 8520 848390 801146 2022-08-19T00:38:54Z 83.122.234.212 /* فعل */ wikitext text/x-wiki =={{{3|انگلیسی}}}== ==انگلیسی== ===اسم=== #جنسیت #جنس #نر یا ماده، پسر یا دختر، زن یا مرد #مسائل جنسی #نزدیکی، آمیزش جنسی، سکس ===صفت=== #جنسی پسرباپسر #سکسی ===فعل=== #جنسیت (حیوانی را) تعیین کردن - --- ==لاتین== ===عدد=== {{عدد-لا|sex}} # [[شش]] ====زاده‌ها==== * {{desc|it|sei}} [[رده:اسم، صفت، فعل انگلیسی]] 2ipo983xstasoezsxrgm8vbcvx5z773 848391 848390 2022-08-19T00:42:00Z 83.122.234.212 /* فعل */ دختر کوس wikitext text/x-wiki =={{{3|انگلیسی}}}== ==انگلیسی== ===اسم=== #جنسیت #جنس #نر یا ماده، پسر یا دختر، زن یا مرد #مسائل جنسی #نزدیکی، آمیزش جنسی، سکس ===صفت=== #جنسی پسرباپسر #سکسی ===فعل=== #جنسیت (حیوانی را) تعیین کردن -دختر کوس °دختر کوس --- ==لاتین== ===عدد=== {{عدد-لا|sex}} # [[شش]] ====زاده‌ها==== * {{desc|it|sei}} [[رده:اسم، صفت، فعل انگلیسی]] 5im6oqkjb2xe52a41myhhwgip00fsjj 848392 848391 2022-08-19T00:48:04Z 83.122.234.212 /* اسم */ اما م wikitext text/x-wiki =={{{3|انگلیسی}}}== ==انگلیسی== ===اسم=== #جنسیت #جنس #نر یا ماده، پس ر یا دختر، زن یا مرد #مسائل جنسی #نزدیکی، آمیزش جنسی، سکس ===صفت=== #جنسی پسرباپسر #سکسی ===فعل=== #جنسیت (حیوانی را) تعیین کردن -دختر کوس °دختر کوس --- ==لاتین== ===عدد=== {{عدد-لا|sex}} # [[شش]] ====زاده‌ها==== * {{desc|it|sei}} [[رده:اسم، صفت، فعل انگلیسی]] b8c44690hwruffvakkb7waacdtei3n7 848399 848392 2022-08-19T02:36:53Z HAKHSIN 4580 ویرایش [[Special:Contributions/83.122.234.212|83.122.234.212]] ([[User talk:83.122.234.212|بحث]]) به آخرین تغییری که [[User:AhmadWikiBot|AhmadWikiBot]] انجام داده بود واگردانده شد wikitext text/x-wiki =={{{3|انگلیسی}}}== ==انگلیسی== ===اسم=== #جنسیت #جنس #نر یا ماده، پسر یا دختر، زن یا مرد #مسائل جنسی #نزدیکی، آمیزش جنسی، سکس ===صفت=== #جنسی پسرباپسر #سکسی ===فعل=== #جنسیت (حیوانی را) تعیین کردن ---- ==لاتین== ===عدد=== {{عدد-لا|sex}} # [[شش]] ====زاده‌ها==== * {{desc|it|sei}} [[رده:اسم، صفت، فعل انگلیسی]] o5k1y8wftfbj3uox00t24lj5nb0pg95 obey 0 11101 848400 848284 2022-08-19T02:37:51Z HAKHSIN 4580 ویرایش [[Special:Contributions/2A01:5EC0:9812:9CFD:E253:2A08:188F:3609|2A01:5EC0:9812:9CFD:E253:2A08:188F:3609]] ([[User talk:2A01:5EC0:9812:9CFD:E253:2A08:188F:3609|بحث]]) به آخرین تغییری که [[User:AhmadWikiBot|AhmadWikiBot]] انجام داده بود واگردانده شد wikitext text/x-wiki =={{{3|انگلیسی}}}== ===فعل=== #[[فرمانبرداری کردن]] # <!--'''obey'''--> [[رده:فعل‌های انگلیسی]] t5xoj91gjon0t5qc769woiddewq2ine baby 0 12242 848380 848142 2022-08-18T15:09:54Z Beginneruser 11037 wikitext text/x-wiki ==انگلیسی== ===ریشه‌شناسی=== {{multiple images |direction = vertical |image1 = Baby.jpg |caption1 = بچه‌ی آدم |image2 = Baby ginger monkey.jpg |caption2 = بچه‌ی [[monkey#Noun|میمون]] |image3 = Smaller Babyelephant45 from wiki commons.jpg |caption3 = بچه‌ی [[فیل]] }} ===اسم=== {{en-noun}} #[[بچه]] #[[کودک]] #[[عزیزم]] ===صفت=== {{en-adj|er|babyer|baby-er}} ===فعل=== {{en-verb}} #[[مانند]] [[کودک]] [[رفتارکردن]] 917k5kpaam8g0uwrfgir6hluo98dvu8 الگو:صفت-ان 10 17547 848374 818990 2022-08-18T14:49:25Z Beginneruser 11037 تغییرمسیر به [[الگو:en-adj]] wikitext text/x-wiki #تغییرمسیر [[الگو:en-adj]] bsld7shq7vle82zmfjtzct12dsigxui رده:صفت‌های انگلیسی 14 18037 848379 759063 2022-08-18T15:07:52Z Beginneruser 11037 wikitext text/x-wiki [[رده:صفت]] [[رده:انگلیسی]] [[رده:زبان انگلیسی]] [[رده:صفت‌ها]] [[رده:صفت‌ها بر پایه زبان]] [[رده:بن‌واژه‌های انگلیسی]] at3mx2s5magl9yaompu6c1ga4o48pmy الگو:en-adj 10 26385 848375 150361 2022-08-18T14:49:29Z Beginneruser 11037 Imported from [[en:Template:en-adj]] wikitext text/x-wiki {{#invoke:en-headword|show|صفت‌ها}}<!-- --><noinclude>{{documentation}}</noinclude> qkioq6egwzdtufhamoltpkghzysfare 848378 848375 2022-08-18T15:07:00Z Beginneruser 11037 wikitext text/x-wiki {{#invoke:en-headword|show|صفت‌های}}<!-- --><noinclude>{{documentation}}</noinclude> t476pacrb1hhk4wfsvjcousxc9ixt14 پوفیوز 0 77045 848385 844594 2022-08-18T17:20:51Z 188.210.149.120 wikitext text/x-wiki به معنای پست فطرت و انسان رذل بوده و یک نوع ناسزا و فحش در هنگام دعوا می باشد ( دهخدا) در زبان عامیانه به کسی گویند که در مراسم نوشیدن باده و شراب و عرقعرق نمیخورد اما مزه عرق خوران را میخورد. (دهخدا) پوفیوز یه واژه اصالتا فرانسوی هست pouffiasse که به معنی زن فاحشه هست 1nuttr7ef9ugra1fdlsdyl8nlgx0iww 848397 848385 2022-08-19T02:36:15Z HAKHSIN 4580 ویرایش [[Special:Contributions/188.210.149.120|188.210.149.120]] ([[User talk:188.210.149.120|بحث]]) به آخرین تغییری که [[User:HAKHSIN|HAKHSIN]] انجام داده بود واگردانده شد wikitext text/x-wiki به معنای پست فطرت و انسان رذل بوده و یک نوع ناسزا و فحش در هنگام دعوا می باشد ( دهخدا) در زبان عامیانه به کسی گویند که در مراسم نوشیدن باده و شراب و عرقعرق نمیخورد اما مزه عرق خوران را میخورد. (دهخدا) 0byl3bbybse3jnezhsuaq9tc0lhmgmu ایکبیری 0 120149 848401 848280 2022-08-19T02:38:14Z HAKHSIN 4580 ویرایش [[Special:Contributions/5.127.198.206|5.127.198.206]] ([[User talk:5.127.198.206|بحث]]) به آخرین تغییری که [[User:HAKHSIN|HAKHSIN]] انجام داده بود واگردانده شد wikitext text/x-wiki ایکْبیری :(ikbiri) در [[گویش گنابادی]] یعنی زشت ، تُحفه ، بدگِل ، خودخواه ، مغرور [[رده:گویش گنابادی]] ریشه این واژه ترکیست Ek Biri = Gereksiz اک به معنی اضافه Ek بیری به معنی شخص Biri اگرچه از این واژه به صورت یکجا در زبان ترکی استانبولی استفاده نمیشود اما از هر دو بخش این واژه به صورت جدا استفاده میشود و همانطور که میدانیم امروزه در زبان فارسی عامیانه به شخصی که دارای چهره زشت و کریهی است اکبیری یا (ایکبیری) میگوییم. dnksi8d7xqnge1j2ce6u2oah5orzwq7 پودمان:en-headword 828 159180 848373 848135 2022-08-18T14:47:36Z Beginneruser 11037 Localization Scribunto text/plain local export = {} local pos_functions = {} local lang = require("Module:languages").getByCode("en") local PAGENAME = mw.title.getCurrentTitle().text local function glossary_link(entry, text) text = text or entry return "[[Appendix:Glossary#" .. entry .. "|" .. text .. "]]" end local function track(page) require("Module:debug").track("en-headword/" .. page) return true 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 params = { ["head"] = {list = true}, ["suff"] = {type = "boolean"}, ["sort"] = {}, } local pos_data = pos_functions[poscat] if pos_data then for key, val in pairs(pos_data.params) do params[key] = val end end local args, unknown_args = require("Module:parameters").process(frame:getParent().args, params, pos_data.return_unknown) if unknown_args and next(unknown_args) then track("unknown args") track("unknown args/POS/" .. tostring(poscat)) for parameter, value in pairs(unknown_args) do track("unknown args/param/" .. tostring(parameter)) mw.log("unknown parameter in [[Module:headword]]: |" .. tostring(parameter) .. "=" .. tostring(value)) end end local data = {lang = lang, pos_category = poscat, categories = {}, heads = args["head"], inflections = {}} if #data.heads == 0 and args.pagename then table.insert(data.heads, args.pagename) end if args["suff"] then data.pos_category = "suffixes" if poscat == "صفت‌های" or poscat == "قید‌های" or poscat == "اسم‌های" or poscat == "فعل‌های" then table.insert(data.categories, ("%s %s-forming suffixes") :format(lang:getCanonicalName(), poscat:gsub("s$", ""))) else error("No category exists for suffixes forming " .. poscat .. ".") end end if pos_data then pos_data.func(args, data) end local extra_categories = {} if PAGENAME:find("[Qq][^Uu]") or PAGENAME:find("[Qq]$") then table.insert(data.categories, lang:getCanonicalName() .. " words containing Q not followed by U") end if PAGENAME:find("([A-Za-z])%1%1") then table.insert(data.categories, lang:getCanonicalName() .. " words containing three consecutive instances of the same letter") end if PAGENAME:find("([A-Za-z])%1%1%1") then table.insert(data.categories, lang:getCanonicalName() .. " words containing four consecutive instances of the same letter") end -- mw.ustring.toNFD performs decomposition, so letters that decompose -- to an ASCII vowel and a diacritic, such as é, are counted as vowels and -- do not need to be included in the pattern. if not mw.ustring.find(mw.ustring.lower(mw.ustring.toNFD(PAGENAME)), "[aeiouyæœø]") then table.insert(data.categories, lang:getCanonicalName() .. " words without vowels") end if PAGENAME:find("yre$") then table.insert(data.categories, lang:getCanonicalName() .. ' words ending in "-yre"') end if not PAGENAME:find(" ") and PAGENAME:len() >= 25 then table.insert(extra_categories, "Long " .. lang:getCanonicalName() .. ' words') end if PAGENAME:find("^[^aeiou ]*a[^aeiou ]*e[^aeiou ]*i[^aeiou ]*o[^aeiou ]*u[^aeiou ]*$") then table.insert(data.categories, lang:getCanonicalName() .. ' words that use all vowels in alphabetical order') end data.sort_key = args.sort return require("Module:headword").full_headword(data) .. (#extra_categories > 0 and require("Module:utilities").format_categories(extra_categories, lang, args.sort) or "") end -- This function does the common work between adjectives and adverbs function make_comparatives(params, data) local comp_parts = {label = glossary_link("comparative"), accel = {form = "comparative"}} local sup_parts = {label = glossary_link("superlative"), accel = {form = "superlative"}} if #params == 0 then table.insert(params, {"more"}) end -- To form the stem, replace -(e)y with -i and remove a final -e. local stem = PAGENAME:gsub("([^aeiou])e?y$", "%1i"):gsub("e$", "") -- Go over each parameter given and create a comparative and superlative form for i, val in ipairs(params) do local comp = val[1] local comp_qual = val[2] local sup = val[3] local sup_qual = val[4] local comp_part, sup_part if comp == "more" and PAGENAME ~= "many" and PAGENAME ~= "much" then comp_part = "[[more]] " .. PAGENAME sup_part = "[[most]] " .. PAGENAME elseif comp == "further" and PAGENAME ~= "far" then comp_part = "[[further]] " .. PAGENAME sup_part = "[[furthest]] " .. PAGENAME elseif comp == "er" then comp_part = stem .. "er" sup_part = stem .. "est" elseif comp == "-" or sup == "-" then -- Allowing '-' makes it more flexible to not have some forms if comp ~= "-" then comp_part = comp end if sup ~= "-" then sup_part = sup end else -- If the full comparative was given, but no superlative, then -- create it by replacing the ending -er with -est. if not sup then if comp:find("er$") then sup = comp:gsub("er$", "est") else error("The superlative of \"" .. comp .. "\" cannot be generated automatically. Please provide it with the \"sup" .. (i == 1 and "" or i) .. "=\" parameter.") end end comp_part = comp sup_part = sup end if comp_part then table.insert(comp_parts, {term = comp_part, qualifiers = {comp_qual}}) end if sup_part then table.insert(sup_parts, {term = sup_part, qualifiers = {sup_qual}}) end end table.insert(data.inflections, comp_parts) table.insert(data.inflections, sup_parts) end pos_functions["صفت‌ها"] = { params = { [1] = {list = true, allow_holes = true}, ["comp_qual"] = {list = "comp=_qual", allow_holes = true}, ["sup"] = {list = true, allow_holes = true}, ["sup_qual"] = {list = "sup=_qual", allow_holes = true}, }, func = function(args, data) local shift = 0 local is_not_comparable = false local is_comparative_only = false -- If the first parameter is ?, then don't show anything, just return. if args[1][1] == "?" then return -- If the first parameter is -, then move all parameters up one position. elseif args[1][1] == "-" then shift = 1 is_not_comparable = true -- If the only argument is +, then remember this and clear parameters elseif args[1][1] == "+" and args[1].maxindex == 1 then shift = 1 is_comparative_only = true end -- Gather all the comparative and superlative parameters. local params = {} for i = 1, args[1].maxindex - shift do local comp = args[1][i + shift] local comp_qual = args["comp_qual"][i + shift] local sup = args["sup"][i] local sup_qual = args["sup_qual"][i + shift] if comp or sup then table.insert(params, {comp, comp_qual, sup, sup_qual}) end end if shift == 1 then -- If the first parameter is "-" but there are no parameters, -- then show "not comparable" only and return. -- If there are parameters, then show "not generally comparable" -- before the forms. if #params == 0 then if is_not_comparable then table.insert(data.inflections, {label = "not " .. glossary_link("comparable")}) table.insert(data.categories, lang:getCanonicalName() .. " uncomparable adjectives") return end if is_comparative_only then table.insert(data.inflections, {label = glossary_link("comparative") .. " form only"}) table.insert(data.categories, lang:getCanonicalName() .. " comparative-only adjectives") return end else table.insert(data.inflections, {label = "not generally " .. glossary_link("comparable")}) end end -- Process the parameters make_comparatives(params, data) end } pos_functions["adverbs"] = { params = { [1] = {list = true, allow_holes = true}, ["comp_qual"] = {list = "comp=_qual", allow_holes = true}, ["sup"] = {list = true, allow_holes = true}, ["sup_qual"] = {list = "sup=_qual", allow_holes = true}, }, func = function(args, data) local shift = 0 -- If the first parameter is ?, then don't show anything, just return. if args[1][1] == "?" then return -- If the first parameter is -, then move all parameters up one position. elseif args[1][1] == "-" then shift = 1 end -- Gather all the comparative and superlative parameters. local params = {} for i = 1, args[1].maxindex - shift do local comp = args[1][i + shift] local comp_qual = args["comp_qual"][i + shift] local sup = args["sup"][i] local sup_qual = args["sup_qual"][i + shift] if comp or sup then table.insert(params, {comp, comp_qual, sup, sup_qual}) end end if shift == 1 then -- If the first parameter is "-" but there are no parameters, -- then show "not comparable" only and return. If there are parameters, -- then show "not generally comparable" before the forms. if #params == 0 then table.insert(data.inflections, {label = "not " .. glossary_link("comparable")}) table.insert(data.categories, lang:getCanonicalName() .. " uncomparable adverbs") return else table.insert(data.inflections, {label = "not generally " .. glossary_link("comparable")}) end end -- Process the parameters make_comparatives(params, data) end } pos_functions["conjunctions"] = { params = { [1] = { alias_of = "head" }, }, return_unknown = true, func = function (args, data) end, } pos_functions["interjections"] = { params = { [1] = { alias_of = "head" }, }, return_unknown = true, func = function (args, data) end, } local function default_plural(noun) local new_pl if noun:find("[sxz]$") or noun:find("[cs]h$") then new_pl = noun .. "es" elseif noun:find("[^aeiou]y$") then new_pl = noun:gsub("y$", "i") .. "es" else new_pl = noun .. "s" end return new_pl end local function canonicalize_plural(pl, stem) if pl == "s" then return stem .. "s" elseif pl == "es" then return stem .. "es" elseif pl == "+" then return default_plural(PAGENAME) else return nil end end pos_functions["اسم‌های"] = { params = { [1] = {list = true, allow_holes = true}, ["pl=qual"] = { list = true, allow_holes = true }, }, func = function(args, data) -- Gather all the plural parameters from the numbered parameters. local plurals = {} for i = 1, args[1].maxindex do local pl = args[1][i] if pl then local qual = args["plqual"][i] if qual then table.insert(plurals, {term = pl, qualifiers = {qual}}) else table.insert(plurals, pl) end end end -- Decide what to do next... local mode = nil if plurals[1] == "?" or plurals[1] == "!" or plurals[1] == "-" or plurals[1] == "~" then mode = plurals[1] table.remove(plurals, 1) -- Remove the mode parameter end -- Plural is unknown if mode == "?" then table.insert(data.categories, lang:getCanonicalName() .. " nouns with unknown or uncertain plurals") return -- Plural is not attested elseif mode == "!" then table.insert(data.inflections, {label = "plural not attested"}) table.insert(data.categories, lang:getCanonicalName() .. " nouns with unattested plurals") return -- Uncountable noun; may occasionally have a plural elseif mode == "-" then table.insert(data.categories, "اسم‌های شمارش‌ناپذیر " .. lang:getCanonicalName()) -- If plural forms were given explicitly, then show "usually" if #plurals > 0 then table.insert(data.inflections, {label = "usually " .. glossary_link("شمارش‌ناپذیر")}) table.insert(data.categories, "اسم‌های شمارش‌پذیر " .. lang:getCanonicalName()) else table.insert(data.inflections, {label = glossary_link("شمارش‌ناپذیر")}) end -- Mixed countable/uncountable noun, always has a plural elseif mode == "~" then table.insert(data.inflections, {label = glossary_link("شمارش‌پذیر") .. " و " .. glossary_link("شمارش‌ناپذیر")}) table.insert(data.categories, "اسم‌های شمارش‌ناپذیر " .. lang:getCanonicalName()) table.insert(data.categories, "اسم‌های شمارش‌پذیر " .. lang:getCanonicalName()) -- If no plural was given, add a default one now if #plurals == 0 then plurals = {default_plural(PAGENAME)} end -- The default, always has a plural else table.insert(data.categories, "اسم‌های شمارش‌پذیر " .. lang:getCanonicalName()) -- If no plural was given, add a default one now if #plurals == 0 then plurals = {default_plural(PAGENAME)} end end -- If there are no plurals to show, return now if #plurals == 0 then return end -- There are plural forms to show, so show them local pl_parts = {label = "جمع", accel = {form = "p"}} local function check_ies(pl, stem) local newplural, nummatches = stem:gsub("([^aeiou])y$","%1ies") return nummatches > 0 and pl == newplural end local stem = PAGENAME local irregular = false for i, pl in ipairs(plurals) do local canon_pl = canonicalize_plural(pl, stem) if canon_pl then table.insert(pl_parts, canon_pl) elseif type(pl) == "table" then canon_pl = canonicalize_plural(pl.term, stem) if canon_pl then table.insert(pl_parts, {term=canon_pl, qualifiers=pl.qualifiers}) end end if not canon_pl then table.insert(pl_parts, pl) if type(pl) == "table" then pl = pl.term end if not stem:find(" ") and not (pl == stem .. "s" or pl == stem .. "es" or check_ies(pl, stem)) then irregular = true if pl == stem then table.insert(data.categories, lang:getCanonicalName() .. " indeclinable nouns") end end end end if irregular then table.insert(data.categories, "اسم‌های دارای جمع‌های باقاعده " .. lang:getCanonicalName()) end table.insert(data.inflections, pl_parts) end } pos_functions["proper nouns"] = { params = { [1] = {list = true}, }, func = function(args, data) local plurals = args[1] -- Decide what to do next... local mode = nil if plurals[1] == "?" or plurals[1] == "!" or plurals[1] == "-" or plurals[1] == "~" then mode = plurals[1] table.remove(plurals, 1) -- Remove the mode parameter end -- Plural is unknown if mode == "?" then table.insert(data.categories, lang:getCanonicalName() .. " proper nouns with unknown or uncertain plurals") return -- Plural is not attested elseif mode == "!" then table.insert(data.inflections, {label = "plural not attested"}) table.insert(data.categories, lang:getCanonicalName() .. " proper nouns with unattested plurals") return -- Uncountable noun; may occasionally have a plural elseif mode == "-" then -- If plural forms were given explicitly, then show "usually" if #plurals > 0 then table.insert(data.inflections, {label = "usually " .. glossary_link("uncountable")}) table.insert(data.categories, lang:getCanonicalName() .. " countable proper nouns") else table.insert(data.inflections, {label = glossary_link("uncountable")}) end -- Mixed countable/uncountable noun, always has a plural elseif mode == "~" then table.insert(data.inflections, {label = glossary_link("countable") .. " and " .. glossary_link("uncountable")}) table.insert(data.categories, lang:getCanonicalName() .. " countable proper nouns") -- If no plural was given, add a default one now if #plurals == 0 then plurals = {"s"} end elseif #plurals > 0 then table.insert(data.categories, lang:getCanonicalName() .. " countable proper nouns") end -- If there are no plurals to show, return now if #plurals == 0 then return end -- There are plural forms to show, so show them local pl_parts = {label = "جمع", accel = {form = "p"}} local stem = PAGENAME for i, pl in ipairs(plurals) do if pl == "s" then table.insert(pl_parts, stem .. "s") elseif pl == "es" then table.insert(pl_parts, stem .. "es") else table.insert(pl_parts, pl) end end table.insert(data.inflections, pl_parts) end } local function base_default_verb_forms(verb) local s_form = default_plural(verb) local ing_form, ed_form local vowel = "aeiouáéíóúàèìòùâêîôûäëïöüæœø" local ulvowel = vowel .. "AEIOUÁÉÍÓÚÀÈÌÒÙÂÊÎÔÛÄËÏÖÜÆŒØ" -- (1) Check for C*VC verbs. -- -- flip -> flipping/flipped, strum -> strumming/strummed, nag -> nagging/nagged, etc. -- Do not include words with final -y, e.g. 'stay' (staying/stayed), 'toy' (toying/toyed), -- or with final -w, e.g. 'flow' (flowing/flowed), or with final -h, e.g. 'ah' (ahing/ahed), -- or with final -x, e.g. 'box' (boxing/boxed), or ending in an uppercase consonant, -- e.g. 'XOR' (XORing/XORed), 'OK' (OKing/OKed). Check specially for initial y- as a consonant, -- e.g. 'yip' (yipping/yipped), otherwise treat y as a vowel, so we don't trigger on 'hyphen' -- but do trigger on 'gyp'. local last_cons = mw.ustring.match(verb, "^[Yy][" .. vowel .. "y]([^A-Z" .. vowel .. "ywxh])$") if not last_cons then last_cons = mw.ustring.match(verb, "^[^" .. ulvowel .. "yY]*[" .. ulvowel .. "yY]([^A-Z" .. vowel .. "ywxh])$") end if last_cons then ing_form = verb .. last_cons .. "ing" ed_form = verb .. last_cons .. "ed" else -- (2) Generate -ing form. -- (2a) lie -> lying, untie -> untying, etc. local stem = verb:match("^(.*)ie$") if stem then ing_form = stem .. "ying" else -- (2b) argue -> arguing, sprue -> spruing, dialogue -> dialoguing, etc. stem = verb:match("^(.*)ue$") if stem then ing_form = stem .. "uing" else stem = mw.ustring.match(verb, "^(.*[" .. ulvowel .. "yY][^" .. vowel .. "y]+)e$") if stem then -- (2c) baptize -> baptizing, rake -> raking, type -> typing, parse -> parsing, etc. -- (ending in vowel + consonant(s) + -e); but not referee -> refereeing, -- backhoe -> backhoeing, redye -> redyeing (ending in some other vowel + -e or in -ye); -- and not be -> being (no vowel before the consonant preceding the -e) ing_form = stem .. "ing" else -- (2d) regular verbs ing_form = verb .. "ing" end end end -- (3) Generate -ed form. if verb:find("e$") then -- (3a) baptize -> baptized, rake -> raked, parse -> parsed, free -> freed, hoe -> hoed ed_form = verb .. "d" else stem = mw.ustring.match(verb, "^(.*[^" .. ulvowel .. "yY])y$") if stem then -- (3b) marry -> married, levy -> levied, try -> tried, etc.; but not toy -> toyed ed_form = stem .. "ied" else -- (3c) regular verbs ed_form = verb .. "ed" end end end return s_form, ing_form, ed_form end local function default_verb_forms(verb) local full_s_form, full_ing_form, full_ed_form = base_default_verb_forms(verb) if verb:find(" ") then local first, rest = verb:match("^(.-)( .*)$") local first_s_form, first_ing_form, first_ed_form = base_default_verb_forms(first) return full_s_form, full_ing_form, full_ed_form, first_s_form .. rest, first_ing_form .. rest, first_ed_form .. rest else return full_s_form, full_ing_form, full_ed_form, nil, nil, nil end end pos_functions["فعل‌های"] = { params = { [1] = {list = "pres_3sg", allow_holes = true}, ["pres_3sg_qual"] = {list = "pres_3sg=_qual", allow_holes = true}, [2] = {list = "pres_ptc", allow_holes = true}, ["pres_ptc_qual"] = {list = "pres_ptc=_qual", allow_holes = true}, [3] = {list = "past", allow_holes = true}, ["past_qual"] = {list = "past=_qual", allow_holes = true}, [4] = {list = "past_ptc", allow_holes = true}, ["past_ptc_qual"] = {list = "past_ptc=_qual", allow_holes = true}, ["pagename"] = {}, -- for testing }, func = function(args, data) -- Get parameters local par1 = args[1][1] local par2 = args[2][1] local par3 = args[3][1] local par4 = args[4][1] local pres_3sgs, pres_ptcs, pasts, past_ptcs local pagename = args.pagename or PAGENAME ------------------------------------------- UTILITY FUNCTIONS #1 ------------------------------------------ -- These functions are used directly in the <> format as well as in the utility functions #2 below. local function compute_double_last_cons_stem(verb) local last_cons = verb:match("([bcdfghjklmnpqrstvwxyzBCDFGHJKLMNPQRSTVWXYZ])$") if not last_cons then error("Verb stem '" .. verb .. "' must end in a consonant to use ++") end return verb .. last_cons end local function compute_plusplus_s_form(verb, default_s_form) if verb:find("[sz]$") then -- regas -> regasses, derez -> derezzes return compute_double_last_cons_stem(verb) .. "es" else return default_s_form end end ------------------------------------------- UTILITY FUNCTIONS #2 ------------------------------------------ -- These functions are used in both in the separate-parameter format and in the override params such as past_ptc2=. local new_default_s, new_default_ing, new_default_ed, split_default_s, split_default_ing, split_default_ed = default_verb_forms(pagename) local function compute_double_last_cons_stem_of_split_verb(verb, ending) local first, rest = verb:match("^(.-)( .*)$") if not first then error("Verb '" .. verb .. "' must have a space in it to use ++*") end local last_cons = first:match("([bcdfghjklmnpqrstvwxyzBCDFGHJKLMNPQRSTVWXYZ])$") if not last_cons then error("First word '" .. first .. "' must end in a consonant to use ++*") end return first .. last_cons .. ending .. rest end local function check_non_nil_star_form(form) if form == nil then error("Verb '" .. pagename .. "' must have a space in it to use * or ++*") end return form end local function sub_tilde(form) if not form then return nil end local retval = form:gsub("~", pagename) -- discard second return value return retval end local function canonicalize_s_form(form) if form == "+" then return new_default_s elseif form == "*" then return check_non_nil_star_form(split_default_s) elseif form == "++" then return compute_plusplus_s_form(pagename, new_default_s) elseif form == "++*" then if pagename:find("^[^ ]*[sz] ") then return compute_double_last_cons_stem_of_split_verb(pagename, "es") else return check_non_nil_star_form(split_default_s) end else return sub_tilde(form) end end local function canonicalize_ing_form(form) if form == "+" then return new_default_ing elseif form == "*" then return check_non_nil_star_form(split_default_ing) elseif form == "++" then return compute_double_last_cons_stem(pagename) .. "ing" elseif form == "++*" then return compute_double_last_cons_stem_of_split_verb(pagename, "ing") else return sub_tilde(form) end end local function canonicalize_ed_form(form) if form == "+" then return new_default_ed elseif form == "*" then return check_non_nil_star_form(split_default_ed) elseif form == "++" then return compute_double_last_cons_stem(pagename) .. "ed" elseif form == "++*" then return compute_double_last_cons_stem_of_split_verb(pagename, "ed") else return sub_tilde(form) end end --------------------------------- MAIN PARSING/CONJUGATING CODE -------------------------------- local past_ptcs_given if par1 and par1:find("<") then -------------------------- ANGLE-BRACKET FORMAT -------------------------- if par2 or par3 or par4 then error("Can't specify 2=, 3= or 4= when 1= contains angle brackets: " .. par1) end -- In the angle bracket format, we always copy the full past tense specs to the past participle -- specs if none of the latter are given, so act as if the past participle is always given. -- There is a separate check to see if the past tense and past participle are identical, in any case. past_ptcs_given = true local iut = require("Module:inflection utilities") -- (1) Parse the indicator specs inside of angle brackets. local function parse_indicator_spec(angle_bracket_spec) local inside = angle_bracket_spec:match("^<(.*)>$") assert(inside) local segments = iut.parse_balanced_segment_run(inside, "[", "]") local comma_separated_groups = iut.split_alternating_runs(segments, ",") if #comma_separated_groups > 4 then error("Too many comma-separated parts in indicator spec: " .. angle_bracket_spec) end local function fetch_qualifiers(separated_group) local qualifiers for j = 2, #separated_group - 1, 2 do if separated_group[j + 1] ~= "" then error("Extraneous text after bracketed qualifiers: '" .. table.concat(separated_group) .. "'") end if not qualifiers then qualifiers = {} end table.insert(qualifiers, separated_group[j]) end return qualifiers end local function fetch_specs(comma_separated_group) if not comma_separated_group then return {{}} end local specs = {} local colon_separated_groups = iut.split_alternating_runs(comma_separated_group, ":") for _, colon_separated_group in ipairs(colon_separated_groups) do local form = colon_separated_group[1] if form == "*" or form == "++*" then error("* and ++* not allowed inside of indicator specs: " .. angle_bracket_spec) end if form == "" then form = nil end table.insert(specs, {form = form, qualifiers = fetch_qualifiers(colon_separated_group)}) end return specs end local s_specs = fetch_specs(comma_separated_groups[1]) local ing_specs = fetch_specs(comma_separated_groups[2]) local ed_specs = fetch_specs(comma_separated_groups[3]) local en_specs = fetch_specs(comma_separated_groups[4]) for _, spec in ipairs(s_specs) do if spec.form == "++" and #ing_specs == 1 and not ing_specs[1].form and not ing_specs[1].qualifiers and #ed_specs == 1 and not ed_specs[1].form and not ed_specs[1].qualifiers then ing_specs[1].form = "++" ed_specs[1].form = "++" break end end return { forms = {}, s_specs = s_specs, ing_specs = ing_specs, ed_specs = ed_specs, en_specs = en_specs, } end local parse_props = { parse_indicator_spec = parse_indicator_spec, } local alternant_multiword_spec = iut.parse_inflected_text(par1, parse_props) -- (2) Remove any links from the lemma, but remember the original form -- so we can use it below in the 'lemma_linked' form. iut.map_word_specs(alternant_multiword_spec, function(base) if base.lemma == "" then base.lemma = pagename end base.orig_lemma = base.lemma base.lemma = require("Module:links").remove_links(base.lemma) end) -- (3) Conjugate the verbs according to the indicator specs parsed above. local all_verb_slots = { lemma = "infinitive", lemma_linked = "infinitive", s_form = "3|s|pres", ing_form = "pres|ptcp", ed_form = "past", en_form = "past|ptcp", } local function conjugate_verb(base) local def_s_form, def_ing_form, def_ed_form = base_default_verb_forms(base.lemma) local function process_specs(slot, specs, default_form, canonicalize_plusplus) for _, spec in ipairs(specs) do local form = spec.form if not form or form == "+" then form = default_form elseif form == "++" then form = canonicalize_plusplus() end -- If there's a ~ in the form, substitute it with the lemma, -- but make sure to first replace % in the lemma with %% so that -- it doesn't get interpreted as a capture replace expression. if form:find("~") then -- Assign to a var because gsub returns multiple values. local subbed_lemma = base.lemma:gsub("%%", "%%%%") form = form:gsub("~", subbed_lemma) end -- If the form is -, don't insert any forms, which will result -- in there being no overall forms (in fact it will be nil). -- We check for that down below and substitute a single "-" as -- the form, which in turn gets turned into special labels like -- "no present participle". if form ~= "-" then iut.insert_form(base.forms, slot, {form = form, footnotes = spec.qualifiers}) end end end process_specs("s_form", base.s_specs, def_s_form, function() return compute_plusplus_s_form(base.lemma, def_s_form) end) process_specs("ing_form", base.ing_specs, def_ing_form, function() return compute_double_last_cons_stem(base.lemma) .. "ing" end) process_specs("ed_form", base.ed_specs, def_ed_form, function() return compute_double_last_cons_stem(base.lemma) .. "ed" end) -- If the -en spec is completely missing, substitute the -ed spec in its entirely. -- Otherwise, if individual -en forms are missing or use +, we will substitute the -- default -ed form, as with the -ed spec. local en_specs = base.en_specs if #en_specs == 1 and not en_specs[1].form and not en_specs[1].qualifiers then en_specs = base.ed_specs end process_specs("en_form", en_specs, def_ed_form, function() return compute_double_last_cons_stem(base.lemma) .. "ed" end) iut.insert_form(base.forms, "بن‌واژه", {form = base.lemma}) -- Add linked version of lemma for use in head=. We write this in a general fashion in case -- there are multiple lemma forms (which isn't possible currently at this level, although it's -- possible overall using the ((...,...)) notation). iut.insert_forms(base.forms, "lemma_linked", iut.map_forms(base.forms.lemma, function(form) if form == base.lemma and base.orig_lemma:find("%[%[") then return base.orig_lemma else return form end end)) end local inflect_props = { slot_table = all_verb_slots, inflect_word_spec = conjugate_verb, } iut.inflect_multiword_or_alternant_multiword_spec(alternant_multiword_spec, inflect_props) -- (4) Fetch the forms and put the conjugated lemmas in data.heads if not explicitly given. local function fetch_forms(slot) local forms = alternant_multiword_spec.forms[slot] -- See above. This should only occur if the user explicitly used - -- for a spec. if not forms or #forms == 0 then forms = {{form = "-"}} end return forms end pres_3sgs = fetch_forms("s_form") pres_ptcs = fetch_forms("ing_form") pasts = fetch_forms("ed_form") past_ptcs = fetch_forms("en_form") -- Use the "linked" form of the lemma as the head if no head= explicitly given. -- If no links in this form and it has multiple words, autolink the individual words. -- The user can override this using head=. if #data.heads == 0 then for _, lemma_obj in ipairs(alternant_multiword_spec.forms.lemma_linked) do local lemma = lemma_obj.form if not lemma:find("%[%[") then local m_headword = require("Module:headword") if m_headword.head_is_multiword(lemma) then lemma = m_headword.add_multiword_links(lemma) end end table.insert(data.heads, lemma) end end else -------------------------- SEPARATE-PARAM FORMAT -------------------------- local pres_3sg, pres_ptc, past if par1 and not par2 and not par3 then -- Use of a single parameter other than "++", "*" or "++*" is now the "legacy" format, -- and no longer supported. if par1 == "es" or par1 == "ies" or par1 == "d" then error("Legacy parameter 1=es/ies/d no longer supported, just use 'en-verb' without params") elseif par1 == "++" or par1 == "*" or par1 == "++*" then pres_3sg = canonicalize_s_form(par1) pres_ptc = canonicalize_ing_form(par1) past = canonicalize_ed_form(par1) else error("Legacy parameter 1=STEM no longer supported, just use 'en-verb' without params") end else if par3 then track("xxx3") elseif par2 then track("xxx2") end end if not pres_3sg or not pres_ptc or not past then -- Either all three should be set above, or none of them. assert(not pres_3sg and not pres_ptc and not past) if par1 then pres_3sg = canonicalize_s_form(par1) else pres_3sg = new_default_s end if par2 then pres_ptc = canonicalize_ing_form(par2) else pres_ptc = new_default_ing end if par3 then past = canonicalize_ed_form(par3) else past = new_default_ed end end if par4 then past_ptcs_given = true past_ptc = canonicalize_ed_form(par4) else past_ptc = past end pres_3sgs = {{form = pres_3sg}} pres_ptcs = {{form = pres_ptc}} pasts = {{form = past}} past_ptcs = {{form = past_ptc}} end ------------------------------------------- HANDLE OVERRIDES ------------------------------------------ local pres_3sg_infls, pres_ptc_infls, past_infls, past_ptc_infls 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 collect_forms(label, accel_form, defaults, overrides, override_qualifiers, canonicalize) if defaults[1].form == "-" then return {label = "no " .. label} else local into_table = {label = label, accel = {form = accel_form}} local maxindex = math.max(#defaults, overrides.maxindex) local qualifiers = override_qualifiers[1] and {override_qualifiers[1]} or strip_brackets(defaults[1].footnotes) table.insert(into_table, {term = defaults[1].form, qualifiers = qualifiers}) -- Present 3rd singular for i = 2, maxindex do local override_form = canonicalize(overrides[i]) if override_form then -- If there is an override such as past_ptc2=..., only use the qualifier specified -- using an override (past_ptc2_qual=...), if any; it doesn't make sense to combine -- an override form with a qualifier specified inside of angle brackets. table.insert(into_table, {term = override_form, qualifiers = {override_qualifiers[i]}}) elseif defaults[i] then -- If the form comes from inside angle brackets, allow any override qualifier -- (past_ptc2_qual=...) to override any qualifier specified inside of angle brackets. -- FIXME: Maybe we should throw an error here if both exist. local qualifiers = override_qualifiers[i] and {override_qualifiers[i]} or strip_brackets(defaults[i].footnotes) table.insert(into_table, {term = defaults[i].form, qualifiers = qualifiers}) end end return into_table end end local pres_3sg_infls = collect_forms("سوم شخص مفرد حال ساده", "3|s|pres", pres_3sgs, args[1], args.pres_3sg_qual, canonicalize_s_form) local pres_ptc_infls = collect_forms("حال استمراری", "pres|ptcp", pres_ptcs, args[2], args.pres_ptc_qual, canonicalize_ing_form) local past_infls = collect_forms("گذشته ساده", "past", pasts, args[3], args.past_qual, canonicalize_ed_form) local past_ptc_infls = collect_forms("گذشته استمراری", "past|ptcp", past_ptcs, args[4], args.past_ptc_qual, canonicalize_ed_form) -- Are the past forms identical to the past participle forms? If so, we use a single -- combined "simple past and past participle" label on the past tense forms. -- We check for two conditions: Either no past participle forms were given at all, or -- they were given but are identical in every way (all forms and qualifiers) to the past -- tense forms. The former "no explicit past participle forms" check is important in the -- "separate-parameter" format; if past tense overrides are given and no past participle -- forms given, the past tense overrides should apply to the past participle as well. -- In the angle-bracket format, it's expected that all forms and qualifiers are specified -- using that format, and we explicitly copy past tense forms and qualifiers to past -- participle ones if the latter are omitted, so we disable to "no explicit past participle -- forms" check. if args[4].maxindex > 0 or args.past_ptc_qual.maxindex > 0 then past_ptcs_given = true end local identical = true -- For the past and past participle to be identical, there must be -- the same number of inflections, and each inflection must match -- in term and qualifiers. if #past_infls ~= #past_ptc_infls then identical = false else for key, val in ipairs(past_infls) do if past_ptc_infls[key].term ~= val.term then identical = false break else local quals1 = past_ptc_infls[key].qualifiers local quals2 = val.qualifiers if (not not quals1) ~= (not not quals2) then -- one is nil, the other is not identical = false elseif quals1 and quals2 then -- qualifiers present in both; each qualifier must match if #quals1 ~= #quals2 then identical = false else for k, v in ipairs(quals1) do if v ~= quals2[k] then identical = false break end end end end if not identical then break end end end end -- Insert the forms table.insert(data.inflections, pres_3sg_infls) table.insert(data.inflections, pres_ptc_infls) if not past_ptcs_given or identical then if past_ptcs[1].form == "-" then past_infls.label = "no simple past or past participle" else past_infls.label = "گذشته ساده و گذشته استمراری" past_infls.accel = {form = "past|and|past|ptcp"} end table.insert(data.inflections, past_infls) else table.insert(data.inflections, past_infls) table.insert(data.inflections, past_ptc_infls) end end } return export 42bc6r2nth3ivgqz53cwtph9oqg1g5f 848376 848373 2022-08-18T15:04:58Z Beginneruser 11037 Localization Scribunto text/plain local export = {} local pos_functions = {} local lang = require("Module:languages").getByCode("en") local PAGENAME = mw.title.getCurrentTitle().text local function glossary_link(entry, text) text = text or entry return "[[Appendix:Glossary#" .. entry .. "|" .. text .. "]]" end local function track(page) require("Module:debug").track("en-headword/" .. page) return true 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 params = { ["head"] = {list = true}, ["suff"] = {type = "boolean"}, ["sort"] = {}, } local pos_data = pos_functions[poscat] if pos_data then for key, val in pairs(pos_data.params) do params[key] = val end end local args, unknown_args = require("Module:parameters").process(frame:getParent().args, params, pos_data.return_unknown) if unknown_args and next(unknown_args) then track("unknown args") track("unknown args/POS/" .. tostring(poscat)) for parameter, value in pairs(unknown_args) do track("unknown args/param/" .. tostring(parameter)) mw.log("unknown parameter in [[Module:headword]]: |" .. tostring(parameter) .. "=" .. tostring(value)) end end local data = {lang = lang, pos_category = poscat, categories = {}, heads = args["head"], inflections = {}} if #data.heads == 0 and args.pagename then table.insert(data.heads, args.pagename) end if args["suff"] then data.pos_category = "suffixes" if poscat == "صفت‌های" or poscat == "قید‌های" or poscat == "اسم‌های" or poscat == "فعل‌های" then table.insert(data.categories, ("%s %s-forming suffixes") :format(lang:getCanonicalName(), poscat:gsub("s$", ""))) else error("No category exists for suffixes forming " .. poscat .. ".") end end if pos_data then pos_data.func(args, data) end local extra_categories = {} if PAGENAME:find("[Qq][^Uu]") or PAGENAME:find("[Qq]$") then table.insert(data.categories, lang:getCanonicalName() .. " words containing Q not followed by U") end if PAGENAME:find("([A-Za-z])%1%1") then table.insert(data.categories, lang:getCanonicalName() .. " words containing three consecutive instances of the same letter") end if PAGENAME:find("([A-Za-z])%1%1%1") then table.insert(data.categories, lang:getCanonicalName() .. " words containing four consecutive instances of the same letter") end -- mw.ustring.toNFD performs decomposition, so letters that decompose -- to an ASCII vowel and a diacritic, such as é, are counted as vowels and -- do not need to be included in the pattern. if not mw.ustring.find(mw.ustring.lower(mw.ustring.toNFD(PAGENAME)), "[aeiouyæœø]") then table.insert(data.categories, lang:getCanonicalName() .. " words without vowels") end if PAGENAME:find("yre$") then table.insert(data.categories, lang:getCanonicalName() .. ' words ending in "-yre"') end if not PAGENAME:find(" ") and PAGENAME:len() >= 25 then table.insert(extra_categories, "Long " .. lang:getCanonicalName() .. ' words') end if PAGENAME:find("^[^aeiou ]*a[^aeiou ]*e[^aeiou ]*i[^aeiou ]*o[^aeiou ]*u[^aeiou ]*$") then table.insert(data.categories, lang:getCanonicalName() .. ' words that use all vowels in alphabetical order') end data.sort_key = args.sort return require("Module:headword").full_headword(data) .. (#extra_categories > 0 and require("Module:utilities").format_categories(extra_categories, lang, args.sort) or "") end -- This function does the common work between adjectives and adverbs function make_comparatives(params, data) local comp_parts = {label = glossary_link("تفضیلی"), accel = {form = "تفضیلی"}} local sup_parts = {label = glossary_link("عالی"), accel = {form = "عالی"}} if #params == 0 then table.insert(params, {"more"}) end -- To form the stem, replace -(e)y with -i and remove a final -e. local stem = PAGENAME:gsub("([^aeiou])e?y$", "%1i"):gsub("e$", "") -- Go over each parameter given and create a comparative and superlative form for i, val in ipairs(params) do local comp = val[1] local comp_qual = val[2] local sup = val[3] local sup_qual = val[4] local comp_part, sup_part if comp == "more" and PAGENAME ~= "many" and PAGENAME ~= "much" then comp_part = "[[more]] " .. PAGENAME sup_part = "[[most]] " .. PAGENAME elseif comp == "further" and PAGENAME ~= "far" then comp_part = "[[further]] " .. PAGENAME sup_part = "[[furthest]] " .. PAGENAME elseif comp == "er" then comp_part = stem .. "er" sup_part = stem .. "est" elseif comp == "-" or sup == "-" then -- Allowing '-' makes it more flexible to not have some forms if comp ~= "-" then comp_part = comp end if sup ~= "-" then sup_part = sup end else -- If the full comparative was given, but no superlative, then -- create it by replacing the ending -er with -est. if not sup then if comp:find("er$") then sup = comp:gsub("er$", "est") else error("The superlative of \"" .. comp .. "\" cannot be generated automatically. Please provide it with the \"sup" .. (i == 1 and "" or i) .. "=\" parameter.") end end comp_part = comp sup_part = sup end if comp_part then table.insert(comp_parts, {term = comp_part, qualifiers = {comp_qual}}) end if sup_part then table.insert(sup_parts, {term = sup_part, qualifiers = {sup_qual}}) end end table.insert(data.inflections, comp_parts) table.insert(data.inflections, sup_parts) end pos_functions["صفت‌ها"] = { params = { [1] = {list = true, allow_holes = true}, ["comp_qual"] = {list = "comp=_qual", allow_holes = true}, ["sup"] = {list = true, allow_holes = true}, ["sup_qual"] = {list = "sup=_qual", allow_holes = true}, }, func = function(args, data) local shift = 0 local is_not_comparable = false local is_comparative_only = false -- If the first parameter is ?, then don't show anything, just return. if args[1][1] == "?" then return -- If the first parameter is -, then move all parameters up one position. elseif args[1][1] == "-" then shift = 1 is_not_comparable = true -- If the only argument is +, then remember this and clear parameters elseif args[1][1] == "+" and args[1].maxindex == 1 then shift = 1 is_comparative_only = true end -- Gather all the comparative and superlative parameters. local params = {} for i = 1, args[1].maxindex - shift do local comp = args[1][i + shift] local comp_qual = args["comp_qual"][i + shift] local sup = args["sup"][i] local sup_qual = args["sup_qual"][i + shift] if comp or sup then table.insert(params, {comp, comp_qual, sup, sup_qual}) end end if shift == 1 then -- If the first parameter is "-" but there are no parameters, -- then show "not comparable" only and return. -- If there are parameters, then show "not generally comparable" -- before the forms. if #params == 0 then if is_not_comparable then table.insert(data.inflections, {label = "not " .. glossary_link("comparable")}) table.insert(data.categories, lang:getCanonicalName() .. " uncomparable adjectives") return end if is_comparative_only then table.insert(data.inflections, {label = glossary_link("تفضیلی") .. " form only"}) table.insert(data.categories, lang:getCanonicalName() .. " comparative-only adjectives") return end else table.insert(data.inflections, {label = "not generally " .. glossary_link("comparable")}) end end -- Process the parameters make_comparatives(params, data) end } pos_functions["adverbs"] = { params = { [1] = {list = true, allow_holes = true}, ["comp_qual"] = {list = "comp=_qual", allow_holes = true}, ["sup"] = {list = true, allow_holes = true}, ["sup_qual"] = {list = "sup=_qual", allow_holes = true}, }, func = function(args, data) local shift = 0 -- If the first parameter is ?, then don't show anything, just return. if args[1][1] == "?" then return -- If the first parameter is -, then move all parameters up one position. elseif args[1][1] == "-" then shift = 1 end -- Gather all the comparative and superlative parameters. local params = {} for i = 1, args[1].maxindex - shift do local comp = args[1][i + shift] local comp_qual = args["comp_qual"][i + shift] local sup = args["sup"][i] local sup_qual = args["sup_qual"][i + shift] if comp or sup then table.insert(params, {comp, comp_qual, sup, sup_qual}) end end if shift == 1 then -- If the first parameter is "-" but there are no parameters, -- then show "not comparable" only and return. If there are parameters, -- then show "not generally comparable" before the forms. if #params == 0 then table.insert(data.inflections, {label = "not " .. glossary_link("comparable")}) table.insert(data.categories, lang:getCanonicalName() .. " uncomparable adverbs") return else table.insert(data.inflections, {label = "not generally " .. glossary_link("comparable")}) end end -- Process the parameters make_comparatives(params, data) end } pos_functions["conjunctions"] = { params = { [1] = { alias_of = "head" }, }, return_unknown = true, func = function (args, data) end, } pos_functions["interjections"] = { params = { [1] = { alias_of = "head" }, }, return_unknown = true, func = function (args, data) end, } local function default_plural(noun) local new_pl if noun:find("[sxz]$") or noun:find("[cs]h$") then new_pl = noun .. "es" elseif noun:find("[^aeiou]y$") then new_pl = noun:gsub("y$", "i") .. "es" else new_pl = noun .. "s" end return new_pl end local function canonicalize_plural(pl, stem) if pl == "s" then return stem .. "s" elseif pl == "es" then return stem .. "es" elseif pl == "+" then return default_plural(PAGENAME) else return nil end end pos_functions["اسم‌های"] = { params = { [1] = {list = true, allow_holes = true}, ["pl=qual"] = { list = true, allow_holes = true }, }, func = function(args, data) -- Gather all the plural parameters from the numbered parameters. local plurals = {} for i = 1, args[1].maxindex do local pl = args[1][i] if pl then local qual = args["plqual"][i] if qual then table.insert(plurals, {term = pl, qualifiers = {qual}}) else table.insert(plurals, pl) end end end -- Decide what to do next... local mode = nil if plurals[1] == "?" or plurals[1] == "!" or plurals[1] == "-" or plurals[1] == "~" then mode = plurals[1] table.remove(plurals, 1) -- Remove the mode parameter end -- Plural is unknown if mode == "?" then table.insert(data.categories, lang:getCanonicalName() .. " nouns with unknown or uncertain plurals") return -- Plural is not attested elseif mode == "!" then table.insert(data.inflections, {label = "plural not attested"}) table.insert(data.categories, lang:getCanonicalName() .. " nouns with unattested plurals") return -- Uncountable noun; may occasionally have a plural elseif mode == "-" then table.insert(data.categories, "اسم‌های شمارش‌ناپذیر " .. lang:getCanonicalName()) -- If plural forms were given explicitly, then show "usually" if #plurals > 0 then table.insert(data.inflections, {label = "usually " .. glossary_link("شمارش‌ناپذیر")}) table.insert(data.categories, "اسم‌های شمارش‌پذیر " .. lang:getCanonicalName()) else table.insert(data.inflections, {label = glossary_link("شمارش‌ناپذیر")}) end -- Mixed countable/uncountable noun, always has a plural elseif mode == "~" then table.insert(data.inflections, {label = glossary_link("شمارش‌پذیر") .. " و " .. glossary_link("شمارش‌ناپذیر")}) table.insert(data.categories, "اسم‌های شمارش‌ناپذیر " .. lang:getCanonicalName()) table.insert(data.categories, "اسم‌های شمارش‌پذیر " .. lang:getCanonicalName()) -- If no plural was given, add a default one now if #plurals == 0 then plurals = {default_plural(PAGENAME)} end -- The default, always has a plural else table.insert(data.categories, "اسم‌های شمارش‌پذیر " .. lang:getCanonicalName()) -- If no plural was given, add a default one now if #plurals == 0 then plurals = {default_plural(PAGENAME)} end end -- If there are no plurals to show, return now if #plurals == 0 then return end -- There are plural forms to show, so show them local pl_parts = {label = "جمع", accel = {form = "p"}} local function check_ies(pl, stem) local newplural, nummatches = stem:gsub("([^aeiou])y$","%1ies") return nummatches > 0 and pl == newplural end local stem = PAGENAME local irregular = false for i, pl in ipairs(plurals) do local canon_pl = canonicalize_plural(pl, stem) if canon_pl then table.insert(pl_parts, canon_pl) elseif type(pl) == "table" then canon_pl = canonicalize_plural(pl.term, stem) if canon_pl then table.insert(pl_parts, {term=canon_pl, qualifiers=pl.qualifiers}) end end if not canon_pl then table.insert(pl_parts, pl) if type(pl) == "table" then pl = pl.term end if not stem:find(" ") and not (pl == stem .. "s" or pl == stem .. "es" or check_ies(pl, stem)) then irregular = true if pl == stem then table.insert(data.categories, lang:getCanonicalName() .. " indeclinable nouns") end end end end if irregular then table.insert(data.categories, "اسم‌های دارای جمع‌های باقاعده " .. lang:getCanonicalName()) end table.insert(data.inflections, pl_parts) end } pos_functions["proper nouns"] = { params = { [1] = {list = true}, }, func = function(args, data) local plurals = args[1] -- Decide what to do next... local mode = nil if plurals[1] == "?" or plurals[1] == "!" or plurals[1] == "-" or plurals[1] == "~" then mode = plurals[1] table.remove(plurals, 1) -- Remove the mode parameter end -- Plural is unknown if mode == "?" then table.insert(data.categories, lang:getCanonicalName() .. " proper nouns with unknown or uncertain plurals") return -- Plural is not attested elseif mode == "!" then table.insert(data.inflections, {label = "plural not attested"}) table.insert(data.categories, lang:getCanonicalName() .. " proper nouns with unattested plurals") return -- Uncountable noun; may occasionally have a plural elseif mode == "-" then -- If plural forms were given explicitly, then show "usually" if #plurals > 0 then table.insert(data.inflections, {label = "usually " .. glossary_link("uncountable")}) table.insert(data.categories, lang:getCanonicalName() .. " countable proper nouns") else table.insert(data.inflections, {label = glossary_link("uncountable")}) end -- Mixed countable/uncountable noun, always has a plural elseif mode == "~" then table.insert(data.inflections, {label = glossary_link("countable") .. " and " .. glossary_link("uncountable")}) table.insert(data.categories, lang:getCanonicalName() .. " countable proper nouns") -- If no plural was given, add a default one now if #plurals == 0 then plurals = {"s"} end elseif #plurals > 0 then table.insert(data.categories, lang:getCanonicalName() .. " countable proper nouns") end -- If there are no plurals to show, return now if #plurals == 0 then return end -- There are plural forms to show, so show them local pl_parts = {label = "جمع", accel = {form = "p"}} local stem = PAGENAME for i, pl in ipairs(plurals) do if pl == "s" then table.insert(pl_parts, stem .. "s") elseif pl == "es" then table.insert(pl_parts, stem .. "es") else table.insert(pl_parts, pl) end end table.insert(data.inflections, pl_parts) end } local function base_default_verb_forms(verb) local s_form = default_plural(verb) local ing_form, ed_form local vowel = "aeiouáéíóúàèìòùâêîôûäëïöüæœø" local ulvowel = vowel .. "AEIOUÁÉÍÓÚÀÈÌÒÙÂÊÎÔÛÄËÏÖÜÆŒØ" -- (1) Check for C*VC verbs. -- -- flip -> flipping/flipped, strum -> strumming/strummed, nag -> nagging/nagged, etc. -- Do not include words with final -y, e.g. 'stay' (staying/stayed), 'toy' (toying/toyed), -- or with final -w, e.g. 'flow' (flowing/flowed), or with final -h, e.g. 'ah' (ahing/ahed), -- or with final -x, e.g. 'box' (boxing/boxed), or ending in an uppercase consonant, -- e.g. 'XOR' (XORing/XORed), 'OK' (OKing/OKed). Check specially for initial y- as a consonant, -- e.g. 'yip' (yipping/yipped), otherwise treat y as a vowel, so we don't trigger on 'hyphen' -- but do trigger on 'gyp'. local last_cons = mw.ustring.match(verb, "^[Yy][" .. vowel .. "y]([^A-Z" .. vowel .. "ywxh])$") if not last_cons then last_cons = mw.ustring.match(verb, "^[^" .. ulvowel .. "yY]*[" .. ulvowel .. "yY]([^A-Z" .. vowel .. "ywxh])$") end if last_cons then ing_form = verb .. last_cons .. "ing" ed_form = verb .. last_cons .. "ed" else -- (2) Generate -ing form. -- (2a) lie -> lying, untie -> untying, etc. local stem = verb:match("^(.*)ie$") if stem then ing_form = stem .. "ying" else -- (2b) argue -> arguing, sprue -> spruing, dialogue -> dialoguing, etc. stem = verb:match("^(.*)ue$") if stem then ing_form = stem .. "uing" else stem = mw.ustring.match(verb, "^(.*[" .. ulvowel .. "yY][^" .. vowel .. "y]+)e$") if stem then -- (2c) baptize -> baptizing, rake -> raking, type -> typing, parse -> parsing, etc. -- (ending in vowel + consonant(s) + -e); but not referee -> refereeing, -- backhoe -> backhoeing, redye -> redyeing (ending in some other vowel + -e or in -ye); -- and not be -> being (no vowel before the consonant preceding the -e) ing_form = stem .. "ing" else -- (2d) regular verbs ing_form = verb .. "ing" end end end -- (3) Generate -ed form. if verb:find("e$") then -- (3a) baptize -> baptized, rake -> raked, parse -> parsed, free -> freed, hoe -> hoed ed_form = verb .. "d" else stem = mw.ustring.match(verb, "^(.*[^" .. ulvowel .. "yY])y$") if stem then -- (3b) marry -> married, levy -> levied, try -> tried, etc.; but not toy -> toyed ed_form = stem .. "ied" else -- (3c) regular verbs ed_form = verb .. "ed" end end end return s_form, ing_form, ed_form end local function default_verb_forms(verb) local full_s_form, full_ing_form, full_ed_form = base_default_verb_forms(verb) if verb:find(" ") then local first, rest = verb:match("^(.-)( .*)$") local first_s_form, first_ing_form, first_ed_form = base_default_verb_forms(first) return full_s_form, full_ing_form, full_ed_form, first_s_form .. rest, first_ing_form .. rest, first_ed_form .. rest else return full_s_form, full_ing_form, full_ed_form, nil, nil, nil end end pos_functions["فعل‌های"] = { params = { [1] = {list = "pres_3sg", allow_holes = true}, ["pres_3sg_qual"] = {list = "pres_3sg=_qual", allow_holes = true}, [2] = {list = "pres_ptc", allow_holes = true}, ["pres_ptc_qual"] = {list = "pres_ptc=_qual", allow_holes = true}, [3] = {list = "past", allow_holes = true}, ["past_qual"] = {list = "past=_qual", allow_holes = true}, [4] = {list = "past_ptc", allow_holes = true}, ["past_ptc_qual"] = {list = "past_ptc=_qual", allow_holes = true}, ["pagename"] = {}, -- for testing }, func = function(args, data) -- Get parameters local par1 = args[1][1] local par2 = args[2][1] local par3 = args[3][1] local par4 = args[4][1] local pres_3sgs, pres_ptcs, pasts, past_ptcs local pagename = args.pagename or PAGENAME ------------------------------------------- UTILITY FUNCTIONS #1 ------------------------------------------ -- These functions are used directly in the <> format as well as in the utility functions #2 below. local function compute_double_last_cons_stem(verb) local last_cons = verb:match("([bcdfghjklmnpqrstvwxyzBCDFGHJKLMNPQRSTVWXYZ])$") if not last_cons then error("Verb stem '" .. verb .. "' must end in a consonant to use ++") end return verb .. last_cons end local function compute_plusplus_s_form(verb, default_s_form) if verb:find("[sz]$") then -- regas -> regasses, derez -> derezzes return compute_double_last_cons_stem(verb) .. "es" else return default_s_form end end ------------------------------------------- UTILITY FUNCTIONS #2 ------------------------------------------ -- These functions are used in both in the separate-parameter format and in the override params such as past_ptc2=. local new_default_s, new_default_ing, new_default_ed, split_default_s, split_default_ing, split_default_ed = default_verb_forms(pagename) local function compute_double_last_cons_stem_of_split_verb(verb, ending) local first, rest = verb:match("^(.-)( .*)$") if not first then error("Verb '" .. verb .. "' must have a space in it to use ++*") end local last_cons = first:match("([bcdfghjklmnpqrstvwxyzBCDFGHJKLMNPQRSTVWXYZ])$") if not last_cons then error("First word '" .. first .. "' must end in a consonant to use ++*") end return first .. last_cons .. ending .. rest end local function check_non_nil_star_form(form) if form == nil then error("Verb '" .. pagename .. "' must have a space in it to use * or ++*") end return form end local function sub_tilde(form) if not form then return nil end local retval = form:gsub("~", pagename) -- discard second return value return retval end local function canonicalize_s_form(form) if form == "+" then return new_default_s elseif form == "*" then return check_non_nil_star_form(split_default_s) elseif form == "++" then return compute_plusplus_s_form(pagename, new_default_s) elseif form == "++*" then if pagename:find("^[^ ]*[sz] ") then return compute_double_last_cons_stem_of_split_verb(pagename, "es") else return check_non_nil_star_form(split_default_s) end else return sub_tilde(form) end end local function canonicalize_ing_form(form) if form == "+" then return new_default_ing elseif form == "*" then return check_non_nil_star_form(split_default_ing) elseif form == "++" then return compute_double_last_cons_stem(pagename) .. "ing" elseif form == "++*" then return compute_double_last_cons_stem_of_split_verb(pagename, "ing") else return sub_tilde(form) end end local function canonicalize_ed_form(form) if form == "+" then return new_default_ed elseif form == "*" then return check_non_nil_star_form(split_default_ed) elseif form == "++" then return compute_double_last_cons_stem(pagename) .. "ed" elseif form == "++*" then return compute_double_last_cons_stem_of_split_verb(pagename, "ed") else return sub_tilde(form) end end --------------------------------- MAIN PARSING/CONJUGATING CODE -------------------------------- local past_ptcs_given if par1 and par1:find("<") then -------------------------- ANGLE-BRACKET FORMAT -------------------------- if par2 or par3 or par4 then error("Can't specify 2=, 3= or 4= when 1= contains angle brackets: " .. par1) end -- In the angle bracket format, we always copy the full past tense specs to the past participle -- specs if none of the latter are given, so act as if the past participle is always given. -- There is a separate check to see if the past tense and past participle are identical, in any case. past_ptcs_given = true local iut = require("Module:inflection utilities") -- (1) Parse the indicator specs inside of angle brackets. local function parse_indicator_spec(angle_bracket_spec) local inside = angle_bracket_spec:match("^<(.*)>$") assert(inside) local segments = iut.parse_balanced_segment_run(inside, "[", "]") local comma_separated_groups = iut.split_alternating_runs(segments, ",") if #comma_separated_groups > 4 then error("Too many comma-separated parts in indicator spec: " .. angle_bracket_spec) end local function fetch_qualifiers(separated_group) local qualifiers for j = 2, #separated_group - 1, 2 do if separated_group[j + 1] ~= "" then error("Extraneous text after bracketed qualifiers: '" .. table.concat(separated_group) .. "'") end if not qualifiers then qualifiers = {} end table.insert(qualifiers, separated_group[j]) end return qualifiers end local function fetch_specs(comma_separated_group) if not comma_separated_group then return {{}} end local specs = {} local colon_separated_groups = iut.split_alternating_runs(comma_separated_group, ":") for _, colon_separated_group in ipairs(colon_separated_groups) do local form = colon_separated_group[1] if form == "*" or form == "++*" then error("* and ++* not allowed inside of indicator specs: " .. angle_bracket_spec) end if form == "" then form = nil end table.insert(specs, {form = form, qualifiers = fetch_qualifiers(colon_separated_group)}) end return specs end local s_specs = fetch_specs(comma_separated_groups[1]) local ing_specs = fetch_specs(comma_separated_groups[2]) local ed_specs = fetch_specs(comma_separated_groups[3]) local en_specs = fetch_specs(comma_separated_groups[4]) for _, spec in ipairs(s_specs) do if spec.form == "++" and #ing_specs == 1 and not ing_specs[1].form and not ing_specs[1].qualifiers and #ed_specs == 1 and not ed_specs[1].form and not ed_specs[1].qualifiers then ing_specs[1].form = "++" ed_specs[1].form = "++" break end end return { forms = {}, s_specs = s_specs, ing_specs = ing_specs, ed_specs = ed_specs, en_specs = en_specs, } end local parse_props = { parse_indicator_spec = parse_indicator_spec, } local alternant_multiword_spec = iut.parse_inflected_text(par1, parse_props) -- (2) Remove any links from the lemma, but remember the original form -- so we can use it below in the 'lemma_linked' form. iut.map_word_specs(alternant_multiword_spec, function(base) if base.lemma == "" then base.lemma = pagename end base.orig_lemma = base.lemma base.lemma = require("Module:links").remove_links(base.lemma) end) -- (3) Conjugate the verbs according to the indicator specs parsed above. local all_verb_slots = { lemma = "infinitive", lemma_linked = "infinitive", s_form = "3|s|pres", ing_form = "pres|ptcp", ed_form = "past", en_form = "past|ptcp", } local function conjugate_verb(base) local def_s_form, def_ing_form, def_ed_form = base_default_verb_forms(base.lemma) local function process_specs(slot, specs, default_form, canonicalize_plusplus) for _, spec in ipairs(specs) do local form = spec.form if not form or form == "+" then form = default_form elseif form == "++" then form = canonicalize_plusplus() end -- If there's a ~ in the form, substitute it with the lemma, -- but make sure to first replace % in the lemma with %% so that -- it doesn't get interpreted as a capture replace expression. if form:find("~") then -- Assign to a var because gsub returns multiple values. local subbed_lemma = base.lemma:gsub("%%", "%%%%") form = form:gsub("~", subbed_lemma) end -- If the form is -, don't insert any forms, which will result -- in there being no overall forms (in fact it will be nil). -- We check for that down below and substitute a single "-" as -- the form, which in turn gets turned into special labels like -- "no present participle". if form ~= "-" then iut.insert_form(base.forms, slot, {form = form, footnotes = spec.qualifiers}) end end end process_specs("s_form", base.s_specs, def_s_form, function() return compute_plusplus_s_form(base.lemma, def_s_form) end) process_specs("ing_form", base.ing_specs, def_ing_form, function() return compute_double_last_cons_stem(base.lemma) .. "ing" end) process_specs("ed_form", base.ed_specs, def_ed_form, function() return compute_double_last_cons_stem(base.lemma) .. "ed" end) -- If the -en spec is completely missing, substitute the -ed spec in its entirely. -- Otherwise, if individual -en forms are missing or use +, we will substitute the -- default -ed form, as with the -ed spec. local en_specs = base.en_specs if #en_specs == 1 and not en_specs[1].form and not en_specs[1].qualifiers then en_specs = base.ed_specs end process_specs("en_form", en_specs, def_ed_form, function() return compute_double_last_cons_stem(base.lemma) .. "ed" end) iut.insert_form(base.forms, "بن‌واژه", {form = base.lemma}) -- Add linked version of lemma for use in head=. We write this in a general fashion in case -- there are multiple lemma forms (which isn't possible currently at this level, although it's -- possible overall using the ((...,...)) notation). iut.insert_forms(base.forms, "lemma_linked", iut.map_forms(base.forms.lemma, function(form) if form == base.lemma and base.orig_lemma:find("%[%[") then return base.orig_lemma else return form end end)) end local inflect_props = { slot_table = all_verb_slots, inflect_word_spec = conjugate_verb, } iut.inflect_multiword_or_alternant_multiword_spec(alternant_multiword_spec, inflect_props) -- (4) Fetch the forms and put the conjugated lemmas in data.heads if not explicitly given. local function fetch_forms(slot) local forms = alternant_multiword_spec.forms[slot] -- See above. This should only occur if the user explicitly used - -- for a spec. if not forms or #forms == 0 then forms = {{form = "-"}} end return forms end pres_3sgs = fetch_forms("s_form") pres_ptcs = fetch_forms("ing_form") pasts = fetch_forms("ed_form") past_ptcs = fetch_forms("en_form") -- Use the "linked" form of the lemma as the head if no head= explicitly given. -- If no links in this form and it has multiple words, autolink the individual words. -- The user can override this using head=. if #data.heads == 0 then for _, lemma_obj in ipairs(alternant_multiword_spec.forms.lemma_linked) do local lemma = lemma_obj.form if not lemma:find("%[%[") then local m_headword = require("Module:headword") if m_headword.head_is_multiword(lemma) then lemma = m_headword.add_multiword_links(lemma) end end table.insert(data.heads, lemma) end end else -------------------------- SEPARATE-PARAM FORMAT -------------------------- local pres_3sg, pres_ptc, past if par1 and not par2 and not par3 then -- Use of a single parameter other than "++", "*" or "++*" is now the "legacy" format, -- and no longer supported. if par1 == "es" or par1 == "ies" or par1 == "d" then error("Legacy parameter 1=es/ies/d no longer supported, just use 'en-verb' without params") elseif par1 == "++" or par1 == "*" or par1 == "++*" then pres_3sg = canonicalize_s_form(par1) pres_ptc = canonicalize_ing_form(par1) past = canonicalize_ed_form(par1) else error("Legacy parameter 1=STEM no longer supported, just use 'en-verb' without params") end else if par3 then track("xxx3") elseif par2 then track("xxx2") end end if not pres_3sg or not pres_ptc or not past then -- Either all three should be set above, or none of them. assert(not pres_3sg and not pres_ptc and not past) if par1 then pres_3sg = canonicalize_s_form(par1) else pres_3sg = new_default_s end if par2 then pres_ptc = canonicalize_ing_form(par2) else pres_ptc = new_default_ing end if par3 then past = canonicalize_ed_form(par3) else past = new_default_ed end end if par4 then past_ptcs_given = true past_ptc = canonicalize_ed_form(par4) else past_ptc = past end pres_3sgs = {{form = pres_3sg}} pres_ptcs = {{form = pres_ptc}} pasts = {{form = past}} past_ptcs = {{form = past_ptc}} end ------------------------------------------- HANDLE OVERRIDES ------------------------------------------ local pres_3sg_infls, pres_ptc_infls, past_infls, past_ptc_infls 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 collect_forms(label, accel_form, defaults, overrides, override_qualifiers, canonicalize) if defaults[1].form == "-" then return {label = "no " .. label} else local into_table = {label = label, accel = {form = accel_form}} local maxindex = math.max(#defaults, overrides.maxindex) local qualifiers = override_qualifiers[1] and {override_qualifiers[1]} or strip_brackets(defaults[1].footnotes) table.insert(into_table, {term = defaults[1].form, qualifiers = qualifiers}) -- Present 3rd singular for i = 2, maxindex do local override_form = canonicalize(overrides[i]) if override_form then -- If there is an override such as past_ptc2=..., only use the qualifier specified -- using an override (past_ptc2_qual=...), if any; it doesn't make sense to combine -- an override form with a qualifier specified inside of angle brackets. table.insert(into_table, {term = override_form, qualifiers = {override_qualifiers[i]}}) elseif defaults[i] then -- If the form comes from inside angle brackets, allow any override qualifier -- (past_ptc2_qual=...) to override any qualifier specified inside of angle brackets. -- FIXME: Maybe we should throw an error here if both exist. local qualifiers = override_qualifiers[i] and {override_qualifiers[i]} or strip_brackets(defaults[i].footnotes) table.insert(into_table, {term = defaults[i].form, qualifiers = qualifiers}) end end return into_table end end local pres_3sg_infls = collect_forms("سوم شخص مفرد حال ساده", "3|s|pres", pres_3sgs, args[1], args.pres_3sg_qual, canonicalize_s_form) local pres_ptc_infls = collect_forms("حال استمراری", "pres|ptcp", pres_ptcs, args[2], args.pres_ptc_qual, canonicalize_ing_form) local past_infls = collect_forms("گذشته ساده", "past", pasts, args[3], args.past_qual, canonicalize_ed_form) local past_ptc_infls = collect_forms("گذشته استمراری", "past|ptcp", past_ptcs, args[4], args.past_ptc_qual, canonicalize_ed_form) -- Are the past forms identical to the past participle forms? If so, we use a single -- combined "simple past and past participle" label on the past tense forms. -- We check for two conditions: Either no past participle forms were given at all, or -- they were given but are identical in every way (all forms and qualifiers) to the past -- tense forms. The former "no explicit past participle forms" check is important in the -- "separate-parameter" format; if past tense overrides are given and no past participle -- forms given, the past tense overrides should apply to the past participle as well. -- In the angle-bracket format, it's expected that all forms and qualifiers are specified -- using that format, and we explicitly copy past tense forms and qualifiers to past -- participle ones if the latter are omitted, so we disable to "no explicit past participle -- forms" check. if args[4].maxindex > 0 or args.past_ptc_qual.maxindex > 0 then past_ptcs_given = true end local identical = true -- For the past and past participle to be identical, there must be -- the same number of inflections, and each inflection must match -- in term and qualifiers. if #past_infls ~= #past_ptc_infls then identical = false else for key, val in ipairs(past_infls) do if past_ptc_infls[key].term ~= val.term then identical = false break else local quals1 = past_ptc_infls[key].qualifiers local quals2 = val.qualifiers if (not not quals1) ~= (not not quals2) then -- one is nil, the other is not identical = false elseif quals1 and quals2 then -- qualifiers present in both; each qualifier must match if #quals1 ~= #quals2 then identical = false else for k, v in ipairs(quals1) do if v ~= quals2[k] then identical = false break end end end end if not identical then break end end end end -- Insert the forms table.insert(data.inflections, pres_3sg_infls) table.insert(data.inflections, pres_ptc_infls) if not past_ptcs_given or identical then if past_ptcs[1].form == "-" then past_infls.label = "no simple past or past participle" else past_infls.label = "گذشته ساده و گذشته استمراری" past_infls.accel = {form = "past|and|past|ptcp"} end table.insert(data.inflections, past_infls) else table.insert(data.inflections, past_infls) table.insert(data.inflections, past_ptc_infls) end end } return export 4ej0pko3ggvu19ff9g59hbthrfi1qe1 848377 848376 2022-08-18T15:06:22Z Beginneruser 11037 Scribunto text/plain local export = {} local pos_functions = {} local lang = require("Module:languages").getByCode("en") local PAGENAME = mw.title.getCurrentTitle().text local function glossary_link(entry, text) text = text or entry return "[[Appendix:Glossary#" .. entry .. "|" .. text .. "]]" end local function track(page) require("Module:debug").track("en-headword/" .. page) return true 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 params = { ["head"] = {list = true}, ["suff"] = {type = "boolean"}, ["sort"] = {}, } local pos_data = pos_functions[poscat] if pos_data then for key, val in pairs(pos_data.params) do params[key] = val end end local args, unknown_args = require("Module:parameters").process(frame:getParent().args, params, pos_data.return_unknown) if unknown_args and next(unknown_args) then track("unknown args") track("unknown args/POS/" .. tostring(poscat)) for parameter, value in pairs(unknown_args) do track("unknown args/param/" .. tostring(parameter)) mw.log("unknown parameter in [[Module:headword]]: |" .. tostring(parameter) .. "=" .. tostring(value)) end end local data = {lang = lang, pos_category = poscat, categories = {}, heads = args["head"], inflections = {}} if #data.heads == 0 and args.pagename then table.insert(data.heads, args.pagename) end if args["suff"] then data.pos_category = "suffixes" if poscat == "صفت‌های" or poscat == "قید‌های" or poscat == "اسم‌های" or poscat == "فعل‌های" then table.insert(data.categories, ("%s %s-forming suffixes") :format(lang:getCanonicalName(), poscat:gsub("s$", ""))) else error("No category exists for suffixes forming " .. poscat .. ".") end end if pos_data then pos_data.func(args, data) end local extra_categories = {} if PAGENAME:find("[Qq][^Uu]") or PAGENAME:find("[Qq]$") then table.insert(data.categories, lang:getCanonicalName() .. " words containing Q not followed by U") end if PAGENAME:find("([A-Za-z])%1%1") then table.insert(data.categories, lang:getCanonicalName() .. " words containing three consecutive instances of the same letter") end if PAGENAME:find("([A-Za-z])%1%1%1") then table.insert(data.categories, lang:getCanonicalName() .. " words containing four consecutive instances of the same letter") end -- mw.ustring.toNFD performs decomposition, so letters that decompose -- to an ASCII vowel and a diacritic, such as é, are counted as vowels and -- do not need to be included in the pattern. if not mw.ustring.find(mw.ustring.lower(mw.ustring.toNFD(PAGENAME)), "[aeiouyæœø]") then table.insert(data.categories, lang:getCanonicalName() .. " words without vowels") end if PAGENAME:find("yre$") then table.insert(data.categories, lang:getCanonicalName() .. ' words ending in "-yre"') end if not PAGENAME:find(" ") and PAGENAME:len() >= 25 then table.insert(extra_categories, "Long " .. lang:getCanonicalName() .. ' words') end if PAGENAME:find("^[^aeiou ]*a[^aeiou ]*e[^aeiou ]*i[^aeiou ]*o[^aeiou ]*u[^aeiou ]*$") then table.insert(data.categories, lang:getCanonicalName() .. ' words that use all vowels in alphabetical order') end data.sort_key = args.sort return require("Module:headword").full_headword(data) .. (#extra_categories > 0 and require("Module:utilities").format_categories(extra_categories, lang, args.sort) or "") end -- This function does the common work between adjectives and adverbs function make_comparatives(params, data) local comp_parts = {label = glossary_link("تفضیلی"), accel = {form = "تفضیلی"}} local sup_parts = {label = glossary_link("عالی"), accel = {form = "عالی"}} if #params == 0 then table.insert(params, {"more"}) end -- To form the stem, replace -(e)y with -i and remove a final -e. local stem = PAGENAME:gsub("([^aeiou])e?y$", "%1i"):gsub("e$", "") -- Go over each parameter given and create a comparative and superlative form for i, val in ipairs(params) do local comp = val[1] local comp_qual = val[2] local sup = val[3] local sup_qual = val[4] local comp_part, sup_part if comp == "more" and PAGENAME ~= "many" and PAGENAME ~= "much" then comp_part = "[[more]] " .. PAGENAME sup_part = "[[most]] " .. PAGENAME elseif comp == "further" and PAGENAME ~= "far" then comp_part = "[[further]] " .. PAGENAME sup_part = "[[furthest]] " .. PAGENAME elseif comp == "er" then comp_part = stem .. "er" sup_part = stem .. "est" elseif comp == "-" or sup == "-" then -- Allowing '-' makes it more flexible to not have some forms if comp ~= "-" then comp_part = comp end if sup ~= "-" then sup_part = sup end else -- If the full comparative was given, but no superlative, then -- create it by replacing the ending -er with -est. if not sup then if comp:find("er$") then sup = comp:gsub("er$", "est") else error("The superlative of \"" .. comp .. "\" cannot be generated automatically. Please provide it with the \"sup" .. (i == 1 and "" or i) .. "=\" parameter.") end end comp_part = comp sup_part = sup end if comp_part then table.insert(comp_parts, {term = comp_part, qualifiers = {comp_qual}}) end if sup_part then table.insert(sup_parts, {term = sup_part, qualifiers = {sup_qual}}) end end table.insert(data.inflections, comp_parts) table.insert(data.inflections, sup_parts) end pos_functions["صفت‌های"] = { params = { [1] = {list = true, allow_holes = true}, ["comp_qual"] = {list = "comp=_qual", allow_holes = true}, ["sup"] = {list = true, allow_holes = true}, ["sup_qual"] = {list = "sup=_qual", allow_holes = true}, }, func = function(args, data) local shift = 0 local is_not_comparable = false local is_comparative_only = false -- If the first parameter is ?, then don't show anything, just return. if args[1][1] == "?" then return -- If the first parameter is -, then move all parameters up one position. elseif args[1][1] == "-" then shift = 1 is_not_comparable = true -- If the only argument is +, then remember this and clear parameters elseif args[1][1] == "+" and args[1].maxindex == 1 then shift = 1 is_comparative_only = true end -- Gather all the comparative and superlative parameters. local params = {} for i = 1, args[1].maxindex - shift do local comp = args[1][i + shift] local comp_qual = args["comp_qual"][i + shift] local sup = args["sup"][i] local sup_qual = args["sup_qual"][i + shift] if comp or sup then table.insert(params, {comp, comp_qual, sup, sup_qual}) end end if shift == 1 then -- If the first parameter is "-" but there are no parameters, -- then show "not comparable" only and return. -- If there are parameters, then show "not generally comparable" -- before the forms. if #params == 0 then if is_not_comparable then table.insert(data.inflections, {label = "not " .. glossary_link("comparable")}) table.insert(data.categories, lang:getCanonicalName() .. " uncomparable adjectives") return end if is_comparative_only then table.insert(data.inflections, {label = glossary_link("تفضیلی") .. " form only"}) table.insert(data.categories, lang:getCanonicalName() .. " comparative-only adjectives") return end else table.insert(data.inflections, {label = "not generally " .. glossary_link("comparable")}) end end -- Process the parameters make_comparatives(params, data) end } pos_functions["adverbs"] = { params = { [1] = {list = true, allow_holes = true}, ["comp_qual"] = {list = "comp=_qual", allow_holes = true}, ["sup"] = {list = true, allow_holes = true}, ["sup_qual"] = {list = "sup=_qual", allow_holes = true}, }, func = function(args, data) local shift = 0 -- If the first parameter is ?, then don't show anything, just return. if args[1][1] == "?" then return -- If the first parameter is -, then move all parameters up one position. elseif args[1][1] == "-" then shift = 1 end -- Gather all the comparative and superlative parameters. local params = {} for i = 1, args[1].maxindex - shift do local comp = args[1][i + shift] local comp_qual = args["comp_qual"][i + shift] local sup = args["sup"][i] local sup_qual = args["sup_qual"][i + shift] if comp or sup then table.insert(params, {comp, comp_qual, sup, sup_qual}) end end if shift == 1 then -- If the first parameter is "-" but there are no parameters, -- then show "not comparable" only and return. If there are parameters, -- then show "not generally comparable" before the forms. if #params == 0 then table.insert(data.inflections, {label = "not " .. glossary_link("comparable")}) table.insert(data.categories, lang:getCanonicalName() .. " uncomparable adverbs") return else table.insert(data.inflections, {label = "not generally " .. glossary_link("comparable")}) end end -- Process the parameters make_comparatives(params, data) end } pos_functions["conjunctions"] = { params = { [1] = { alias_of = "head" }, }, return_unknown = true, func = function (args, data) end, } pos_functions["interjections"] = { params = { [1] = { alias_of = "head" }, }, return_unknown = true, func = function (args, data) end, } local function default_plural(noun) local new_pl if noun:find("[sxz]$") or noun:find("[cs]h$") then new_pl = noun .. "es" elseif noun:find("[^aeiou]y$") then new_pl = noun:gsub("y$", "i") .. "es" else new_pl = noun .. "s" end return new_pl end local function canonicalize_plural(pl, stem) if pl == "s" then return stem .. "s" elseif pl == "es" then return stem .. "es" elseif pl == "+" then return default_plural(PAGENAME) else return nil end end pos_functions["اسم‌های"] = { params = { [1] = {list = true, allow_holes = true}, ["pl=qual"] = { list = true, allow_holes = true }, }, func = function(args, data) -- Gather all the plural parameters from the numbered parameters. local plurals = {} for i = 1, args[1].maxindex do local pl = args[1][i] if pl then local qual = args["plqual"][i] if qual then table.insert(plurals, {term = pl, qualifiers = {qual}}) else table.insert(plurals, pl) end end end -- Decide what to do next... local mode = nil if plurals[1] == "?" or plurals[1] == "!" or plurals[1] == "-" or plurals[1] == "~" then mode = plurals[1] table.remove(plurals, 1) -- Remove the mode parameter end -- Plural is unknown if mode == "?" then table.insert(data.categories, lang:getCanonicalName() .. " nouns with unknown or uncertain plurals") return -- Plural is not attested elseif mode == "!" then table.insert(data.inflections, {label = "plural not attested"}) table.insert(data.categories, lang:getCanonicalName() .. " nouns with unattested plurals") return -- Uncountable noun; may occasionally have a plural elseif mode == "-" then table.insert(data.categories, "اسم‌های شمارش‌ناپذیر " .. lang:getCanonicalName()) -- If plural forms were given explicitly, then show "usually" if #plurals > 0 then table.insert(data.inflections, {label = "usually " .. glossary_link("شمارش‌ناپذیر")}) table.insert(data.categories, "اسم‌های شمارش‌پذیر " .. lang:getCanonicalName()) else table.insert(data.inflections, {label = glossary_link("شمارش‌ناپذیر")}) end -- Mixed countable/uncountable noun, always has a plural elseif mode == "~" then table.insert(data.inflections, {label = glossary_link("شمارش‌پذیر") .. " و " .. glossary_link("شمارش‌ناپذیر")}) table.insert(data.categories, "اسم‌های شمارش‌ناپذیر " .. lang:getCanonicalName()) table.insert(data.categories, "اسم‌های شمارش‌پذیر " .. lang:getCanonicalName()) -- If no plural was given, add a default one now if #plurals == 0 then plurals = {default_plural(PAGENAME)} end -- The default, always has a plural else table.insert(data.categories, "اسم‌های شمارش‌پذیر " .. lang:getCanonicalName()) -- If no plural was given, add a default one now if #plurals == 0 then plurals = {default_plural(PAGENAME)} end end -- If there are no plurals to show, return now if #plurals == 0 then return end -- There are plural forms to show, so show them local pl_parts = {label = "جمع", accel = {form = "p"}} local function check_ies(pl, stem) local newplural, nummatches = stem:gsub("([^aeiou])y$","%1ies") return nummatches > 0 and pl == newplural end local stem = PAGENAME local irregular = false for i, pl in ipairs(plurals) do local canon_pl = canonicalize_plural(pl, stem) if canon_pl then table.insert(pl_parts, canon_pl) elseif type(pl) == "table" then canon_pl = canonicalize_plural(pl.term, stem) if canon_pl then table.insert(pl_parts, {term=canon_pl, qualifiers=pl.qualifiers}) end end if not canon_pl then table.insert(pl_parts, pl) if type(pl) == "table" then pl = pl.term end if not stem:find(" ") and not (pl == stem .. "s" or pl == stem .. "es" or check_ies(pl, stem)) then irregular = true if pl == stem then table.insert(data.categories, lang:getCanonicalName() .. " indeclinable nouns") end end end end if irregular then table.insert(data.categories, "اسم‌های دارای جمع‌های باقاعده " .. lang:getCanonicalName()) end table.insert(data.inflections, pl_parts) end } pos_functions["proper nouns"] = { params = { [1] = {list = true}, }, func = function(args, data) local plurals = args[1] -- Decide what to do next... local mode = nil if plurals[1] == "?" or plurals[1] == "!" or plurals[1] == "-" or plurals[1] == "~" then mode = plurals[1] table.remove(plurals, 1) -- Remove the mode parameter end -- Plural is unknown if mode == "?" then table.insert(data.categories, lang:getCanonicalName() .. " proper nouns with unknown or uncertain plurals") return -- Plural is not attested elseif mode == "!" then table.insert(data.inflections, {label = "plural not attested"}) table.insert(data.categories, lang:getCanonicalName() .. " proper nouns with unattested plurals") return -- Uncountable noun; may occasionally have a plural elseif mode == "-" then -- If plural forms were given explicitly, then show "usually" if #plurals > 0 then table.insert(data.inflections, {label = "usually " .. glossary_link("uncountable")}) table.insert(data.categories, lang:getCanonicalName() .. " countable proper nouns") else table.insert(data.inflections, {label = glossary_link("uncountable")}) end -- Mixed countable/uncountable noun, always has a plural elseif mode == "~" then table.insert(data.inflections, {label = glossary_link("countable") .. " and " .. glossary_link("uncountable")}) table.insert(data.categories, lang:getCanonicalName() .. " countable proper nouns") -- If no plural was given, add a default one now if #plurals == 0 then plurals = {"s"} end elseif #plurals > 0 then table.insert(data.categories, lang:getCanonicalName() .. " countable proper nouns") end -- If there are no plurals to show, return now if #plurals == 0 then return end -- There are plural forms to show, so show them local pl_parts = {label = "جمع", accel = {form = "p"}} local stem = PAGENAME for i, pl in ipairs(plurals) do if pl == "s" then table.insert(pl_parts, stem .. "s") elseif pl == "es" then table.insert(pl_parts, stem .. "es") else table.insert(pl_parts, pl) end end table.insert(data.inflections, pl_parts) end } local function base_default_verb_forms(verb) local s_form = default_plural(verb) local ing_form, ed_form local vowel = "aeiouáéíóúàèìòùâêîôûäëïöüæœø" local ulvowel = vowel .. "AEIOUÁÉÍÓÚÀÈÌÒÙÂÊÎÔÛÄËÏÖÜÆŒØ" -- (1) Check for C*VC verbs. -- -- flip -> flipping/flipped, strum -> strumming/strummed, nag -> nagging/nagged, etc. -- Do not include words with final -y, e.g. 'stay' (staying/stayed), 'toy' (toying/toyed), -- or with final -w, e.g. 'flow' (flowing/flowed), or with final -h, e.g. 'ah' (ahing/ahed), -- or with final -x, e.g. 'box' (boxing/boxed), or ending in an uppercase consonant, -- e.g. 'XOR' (XORing/XORed), 'OK' (OKing/OKed). Check specially for initial y- as a consonant, -- e.g. 'yip' (yipping/yipped), otherwise treat y as a vowel, so we don't trigger on 'hyphen' -- but do trigger on 'gyp'. local last_cons = mw.ustring.match(verb, "^[Yy][" .. vowel .. "y]([^A-Z" .. vowel .. "ywxh])$") if not last_cons then last_cons = mw.ustring.match(verb, "^[^" .. ulvowel .. "yY]*[" .. ulvowel .. "yY]([^A-Z" .. vowel .. "ywxh])$") end if last_cons then ing_form = verb .. last_cons .. "ing" ed_form = verb .. last_cons .. "ed" else -- (2) Generate -ing form. -- (2a) lie -> lying, untie -> untying, etc. local stem = verb:match("^(.*)ie$") if stem then ing_form = stem .. "ying" else -- (2b) argue -> arguing, sprue -> spruing, dialogue -> dialoguing, etc. stem = verb:match("^(.*)ue$") if stem then ing_form = stem .. "uing" else stem = mw.ustring.match(verb, "^(.*[" .. ulvowel .. "yY][^" .. vowel .. "y]+)e$") if stem then -- (2c) baptize -> baptizing, rake -> raking, type -> typing, parse -> parsing, etc. -- (ending in vowel + consonant(s) + -e); but not referee -> refereeing, -- backhoe -> backhoeing, redye -> redyeing (ending in some other vowel + -e or in -ye); -- and not be -> being (no vowel before the consonant preceding the -e) ing_form = stem .. "ing" else -- (2d) regular verbs ing_form = verb .. "ing" end end end -- (3) Generate -ed form. if verb:find("e$") then -- (3a) baptize -> baptized, rake -> raked, parse -> parsed, free -> freed, hoe -> hoed ed_form = verb .. "d" else stem = mw.ustring.match(verb, "^(.*[^" .. ulvowel .. "yY])y$") if stem then -- (3b) marry -> married, levy -> levied, try -> tried, etc.; but not toy -> toyed ed_form = stem .. "ied" else -- (3c) regular verbs ed_form = verb .. "ed" end end end return s_form, ing_form, ed_form end local function default_verb_forms(verb) local full_s_form, full_ing_form, full_ed_form = base_default_verb_forms(verb) if verb:find(" ") then local first, rest = verb:match("^(.-)( .*)$") local first_s_form, first_ing_form, first_ed_form = base_default_verb_forms(first) return full_s_form, full_ing_form, full_ed_form, first_s_form .. rest, first_ing_form .. rest, first_ed_form .. rest else return full_s_form, full_ing_form, full_ed_form, nil, nil, nil end end pos_functions["فعل‌های"] = { params = { [1] = {list = "pres_3sg", allow_holes = true}, ["pres_3sg_qual"] = {list = "pres_3sg=_qual", allow_holes = true}, [2] = {list = "pres_ptc", allow_holes = true}, ["pres_ptc_qual"] = {list = "pres_ptc=_qual", allow_holes = true}, [3] = {list = "past", allow_holes = true}, ["past_qual"] = {list = "past=_qual", allow_holes = true}, [4] = {list = "past_ptc", allow_holes = true}, ["past_ptc_qual"] = {list = "past_ptc=_qual", allow_holes = true}, ["pagename"] = {}, -- for testing }, func = function(args, data) -- Get parameters local par1 = args[1][1] local par2 = args[2][1] local par3 = args[3][1] local par4 = args[4][1] local pres_3sgs, pres_ptcs, pasts, past_ptcs local pagename = args.pagename or PAGENAME ------------------------------------------- UTILITY FUNCTIONS #1 ------------------------------------------ -- These functions are used directly in the <> format as well as in the utility functions #2 below. local function compute_double_last_cons_stem(verb) local last_cons = verb:match("([bcdfghjklmnpqrstvwxyzBCDFGHJKLMNPQRSTVWXYZ])$") if not last_cons then error("Verb stem '" .. verb .. "' must end in a consonant to use ++") end return verb .. last_cons end local function compute_plusplus_s_form(verb, default_s_form) if verb:find("[sz]$") then -- regas -> regasses, derez -> derezzes return compute_double_last_cons_stem(verb) .. "es" else return default_s_form end end ------------------------------------------- UTILITY FUNCTIONS #2 ------------------------------------------ -- These functions are used in both in the separate-parameter format and in the override params such as past_ptc2=. local new_default_s, new_default_ing, new_default_ed, split_default_s, split_default_ing, split_default_ed = default_verb_forms(pagename) local function compute_double_last_cons_stem_of_split_verb(verb, ending) local first, rest = verb:match("^(.-)( .*)$") if not first then error("Verb '" .. verb .. "' must have a space in it to use ++*") end local last_cons = first:match("([bcdfghjklmnpqrstvwxyzBCDFGHJKLMNPQRSTVWXYZ])$") if not last_cons then error("First word '" .. first .. "' must end in a consonant to use ++*") end return first .. last_cons .. ending .. rest end local function check_non_nil_star_form(form) if form == nil then error("Verb '" .. pagename .. "' must have a space in it to use * or ++*") end return form end local function sub_tilde(form) if not form then return nil end local retval = form:gsub("~", pagename) -- discard second return value return retval end local function canonicalize_s_form(form) if form == "+" then return new_default_s elseif form == "*" then return check_non_nil_star_form(split_default_s) elseif form == "++" then return compute_plusplus_s_form(pagename, new_default_s) elseif form == "++*" then if pagename:find("^[^ ]*[sz] ") then return compute_double_last_cons_stem_of_split_verb(pagename, "es") else return check_non_nil_star_form(split_default_s) end else return sub_tilde(form) end end local function canonicalize_ing_form(form) if form == "+" then return new_default_ing elseif form == "*" then return check_non_nil_star_form(split_default_ing) elseif form == "++" then return compute_double_last_cons_stem(pagename) .. "ing" elseif form == "++*" then return compute_double_last_cons_stem_of_split_verb(pagename, "ing") else return sub_tilde(form) end end local function canonicalize_ed_form(form) if form == "+" then return new_default_ed elseif form == "*" then return check_non_nil_star_form(split_default_ed) elseif form == "++" then return compute_double_last_cons_stem(pagename) .. "ed" elseif form == "++*" then return compute_double_last_cons_stem_of_split_verb(pagename, "ed") else return sub_tilde(form) end end --------------------------------- MAIN PARSING/CONJUGATING CODE -------------------------------- local past_ptcs_given if par1 and par1:find("<") then -------------------------- ANGLE-BRACKET FORMAT -------------------------- if par2 or par3 or par4 then error("Can't specify 2=, 3= or 4= when 1= contains angle brackets: " .. par1) end -- In the angle bracket format, we always copy the full past tense specs to the past participle -- specs if none of the latter are given, so act as if the past participle is always given. -- There is a separate check to see if the past tense and past participle are identical, in any case. past_ptcs_given = true local iut = require("Module:inflection utilities") -- (1) Parse the indicator specs inside of angle brackets. local function parse_indicator_spec(angle_bracket_spec) local inside = angle_bracket_spec:match("^<(.*)>$") assert(inside) local segments = iut.parse_balanced_segment_run(inside, "[", "]") local comma_separated_groups = iut.split_alternating_runs(segments, ",") if #comma_separated_groups > 4 then error("Too many comma-separated parts in indicator spec: " .. angle_bracket_spec) end local function fetch_qualifiers(separated_group) local qualifiers for j = 2, #separated_group - 1, 2 do if separated_group[j + 1] ~= "" then error("Extraneous text after bracketed qualifiers: '" .. table.concat(separated_group) .. "'") end if not qualifiers then qualifiers = {} end table.insert(qualifiers, separated_group[j]) end return qualifiers end local function fetch_specs(comma_separated_group) if not comma_separated_group then return {{}} end local specs = {} local colon_separated_groups = iut.split_alternating_runs(comma_separated_group, ":") for _, colon_separated_group in ipairs(colon_separated_groups) do local form = colon_separated_group[1] if form == "*" or form == "++*" then error("* and ++* not allowed inside of indicator specs: " .. angle_bracket_spec) end if form == "" then form = nil end table.insert(specs, {form = form, qualifiers = fetch_qualifiers(colon_separated_group)}) end return specs end local s_specs = fetch_specs(comma_separated_groups[1]) local ing_specs = fetch_specs(comma_separated_groups[2]) local ed_specs = fetch_specs(comma_separated_groups[3]) local en_specs = fetch_specs(comma_separated_groups[4]) for _, spec in ipairs(s_specs) do if spec.form == "++" and #ing_specs == 1 and not ing_specs[1].form and not ing_specs[1].qualifiers and #ed_specs == 1 and not ed_specs[1].form and not ed_specs[1].qualifiers then ing_specs[1].form = "++" ed_specs[1].form = "++" break end end return { forms = {}, s_specs = s_specs, ing_specs = ing_specs, ed_specs = ed_specs, en_specs = en_specs, } end local parse_props = { parse_indicator_spec = parse_indicator_spec, } local alternant_multiword_spec = iut.parse_inflected_text(par1, parse_props) -- (2) Remove any links from the lemma, but remember the original form -- so we can use it below in the 'lemma_linked' form. iut.map_word_specs(alternant_multiword_spec, function(base) if base.lemma == "" then base.lemma = pagename end base.orig_lemma = base.lemma base.lemma = require("Module:links").remove_links(base.lemma) end) -- (3) Conjugate the verbs according to the indicator specs parsed above. local all_verb_slots = { lemma = "infinitive", lemma_linked = "infinitive", s_form = "3|s|pres", ing_form = "pres|ptcp", ed_form = "past", en_form = "past|ptcp", } local function conjugate_verb(base) local def_s_form, def_ing_form, def_ed_form = base_default_verb_forms(base.lemma) local function process_specs(slot, specs, default_form, canonicalize_plusplus) for _, spec in ipairs(specs) do local form = spec.form if not form or form == "+" then form = default_form elseif form == "++" then form = canonicalize_plusplus() end -- If there's a ~ in the form, substitute it with the lemma, -- but make sure to first replace % in the lemma with %% so that -- it doesn't get interpreted as a capture replace expression. if form:find("~") then -- Assign to a var because gsub returns multiple values. local subbed_lemma = base.lemma:gsub("%%", "%%%%") form = form:gsub("~", subbed_lemma) end -- If the form is -, don't insert any forms, which will result -- in there being no overall forms (in fact it will be nil). -- We check for that down below and substitute a single "-" as -- the form, which in turn gets turned into special labels like -- "no present participle". if form ~= "-" then iut.insert_form(base.forms, slot, {form = form, footnotes = spec.qualifiers}) end end end process_specs("s_form", base.s_specs, def_s_form, function() return compute_plusplus_s_form(base.lemma, def_s_form) end) process_specs("ing_form", base.ing_specs, def_ing_form, function() return compute_double_last_cons_stem(base.lemma) .. "ing" end) process_specs("ed_form", base.ed_specs, def_ed_form, function() return compute_double_last_cons_stem(base.lemma) .. "ed" end) -- If the -en spec is completely missing, substitute the -ed spec in its entirely. -- Otherwise, if individual -en forms are missing or use +, we will substitute the -- default -ed form, as with the -ed spec. local en_specs = base.en_specs if #en_specs == 1 and not en_specs[1].form and not en_specs[1].qualifiers then en_specs = base.ed_specs end process_specs("en_form", en_specs, def_ed_form, function() return compute_double_last_cons_stem(base.lemma) .. "ed" end) iut.insert_form(base.forms, "بن‌واژه", {form = base.lemma}) -- Add linked version of lemma for use in head=. We write this in a general fashion in case -- there are multiple lemma forms (which isn't possible currently at this level, although it's -- possible overall using the ((...,...)) notation). iut.insert_forms(base.forms, "lemma_linked", iut.map_forms(base.forms.lemma, function(form) if form == base.lemma and base.orig_lemma:find("%[%[") then return base.orig_lemma else return form end end)) end local inflect_props = { slot_table = all_verb_slots, inflect_word_spec = conjugate_verb, } iut.inflect_multiword_or_alternant_multiword_spec(alternant_multiword_spec, inflect_props) -- (4) Fetch the forms and put the conjugated lemmas in data.heads if not explicitly given. local function fetch_forms(slot) local forms = alternant_multiword_spec.forms[slot] -- See above. This should only occur if the user explicitly used - -- for a spec. if not forms or #forms == 0 then forms = {{form = "-"}} end return forms end pres_3sgs = fetch_forms("s_form") pres_ptcs = fetch_forms("ing_form") pasts = fetch_forms("ed_form") past_ptcs = fetch_forms("en_form") -- Use the "linked" form of the lemma as the head if no head= explicitly given. -- If no links in this form and it has multiple words, autolink the individual words. -- The user can override this using head=. if #data.heads == 0 then for _, lemma_obj in ipairs(alternant_multiword_spec.forms.lemma_linked) do local lemma = lemma_obj.form if not lemma:find("%[%[") then local m_headword = require("Module:headword") if m_headword.head_is_multiword(lemma) then lemma = m_headword.add_multiword_links(lemma) end end table.insert(data.heads, lemma) end end else -------------------------- SEPARATE-PARAM FORMAT -------------------------- local pres_3sg, pres_ptc, past if par1 and not par2 and not par3 then -- Use of a single parameter other than "++", "*" or "++*" is now the "legacy" format, -- and no longer supported. if par1 == "es" or par1 == "ies" or par1 == "d" then error("Legacy parameter 1=es/ies/d no longer supported, just use 'en-verb' without params") elseif par1 == "++" or par1 == "*" or par1 == "++*" then pres_3sg = canonicalize_s_form(par1) pres_ptc = canonicalize_ing_form(par1) past = canonicalize_ed_form(par1) else error("Legacy parameter 1=STEM no longer supported, just use 'en-verb' without params") end else if par3 then track("xxx3") elseif par2 then track("xxx2") end end if not pres_3sg or not pres_ptc or not past then -- Either all three should be set above, or none of them. assert(not pres_3sg and not pres_ptc and not past) if par1 then pres_3sg = canonicalize_s_form(par1) else pres_3sg = new_default_s end if par2 then pres_ptc = canonicalize_ing_form(par2) else pres_ptc = new_default_ing end if par3 then past = canonicalize_ed_form(par3) else past = new_default_ed end end if par4 then past_ptcs_given = true past_ptc = canonicalize_ed_form(par4) else past_ptc = past end pres_3sgs = {{form = pres_3sg}} pres_ptcs = {{form = pres_ptc}} pasts = {{form = past}} past_ptcs = {{form = past_ptc}} end ------------------------------------------- HANDLE OVERRIDES ------------------------------------------ local pres_3sg_infls, pres_ptc_infls, past_infls, past_ptc_infls 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 collect_forms(label, accel_form, defaults, overrides, override_qualifiers, canonicalize) if defaults[1].form == "-" then return {label = "no " .. label} else local into_table = {label = label, accel = {form = accel_form}} local maxindex = math.max(#defaults, overrides.maxindex) local qualifiers = override_qualifiers[1] and {override_qualifiers[1]} or strip_brackets(defaults[1].footnotes) table.insert(into_table, {term = defaults[1].form, qualifiers = qualifiers}) -- Present 3rd singular for i = 2, maxindex do local override_form = canonicalize(overrides[i]) if override_form then -- If there is an override such as past_ptc2=..., only use the qualifier specified -- using an override (past_ptc2_qual=...), if any; it doesn't make sense to combine -- an override form with a qualifier specified inside of angle brackets. table.insert(into_table, {term = override_form, qualifiers = {override_qualifiers[i]}}) elseif defaults[i] then -- If the form comes from inside angle brackets, allow any override qualifier -- (past_ptc2_qual=...) to override any qualifier specified inside of angle brackets. -- FIXME: Maybe we should throw an error here if both exist. local qualifiers = override_qualifiers[i] and {override_qualifiers[i]} or strip_brackets(defaults[i].footnotes) table.insert(into_table, {term = defaults[i].form, qualifiers = qualifiers}) end end return into_table end end local pres_3sg_infls = collect_forms("سوم شخص مفرد حال ساده", "3|s|pres", pres_3sgs, args[1], args.pres_3sg_qual, canonicalize_s_form) local pres_ptc_infls = collect_forms("حال استمراری", "pres|ptcp", pres_ptcs, args[2], args.pres_ptc_qual, canonicalize_ing_form) local past_infls = collect_forms("گذشته ساده", "past", pasts, args[3], args.past_qual, canonicalize_ed_form) local past_ptc_infls = collect_forms("گذشته استمراری", "past|ptcp", past_ptcs, args[4], args.past_ptc_qual, canonicalize_ed_form) -- Are the past forms identical to the past participle forms? If so, we use a single -- combined "simple past and past participle" label on the past tense forms. -- We check for two conditions: Either no past participle forms were given at all, or -- they were given but are identical in every way (all forms and qualifiers) to the past -- tense forms. The former "no explicit past participle forms" check is important in the -- "separate-parameter" format; if past tense overrides are given and no past participle -- forms given, the past tense overrides should apply to the past participle as well. -- In the angle-bracket format, it's expected that all forms and qualifiers are specified -- using that format, and we explicitly copy past tense forms and qualifiers to past -- participle ones if the latter are omitted, so we disable to "no explicit past participle -- forms" check. if args[4].maxindex > 0 or args.past_ptc_qual.maxindex > 0 then past_ptcs_given = true end local identical = true -- For the past and past participle to be identical, there must be -- the same number of inflections, and each inflection must match -- in term and qualifiers. if #past_infls ~= #past_ptc_infls then identical = false else for key, val in ipairs(past_infls) do if past_ptc_infls[key].term ~= val.term then identical = false break else local quals1 = past_ptc_infls[key].qualifiers local quals2 = val.qualifiers if (not not quals1) ~= (not not quals2) then -- one is nil, the other is not identical = false elseif quals1 and quals2 then -- qualifiers present in both; each qualifier must match if #quals1 ~= #quals2 then identical = false else for k, v in ipairs(quals1) do if v ~= quals2[k] then identical = false break end end end end if not identical then break end end end end -- Insert the forms table.insert(data.inflections, pres_3sg_infls) table.insert(data.inflections, pres_ptc_infls) if not past_ptcs_given or identical then if past_ptcs[1].form == "-" then past_infls.label = "no simple past or past participle" else past_infls.label = "گذشته ساده و گذشته استمراری" past_infls.accel = {form = "past|and|past|ptcp"} end table.insert(data.inflections, past_infls) else table.insert(data.inflections, past_infls) table.insert(data.inflections, past_ptc_infls) end end } return export cd3xu9am538j3ypcvk4ftpcrug3xfmi پودمان:headword 828 159181 848381 847590 2022-08-18T15:23:11Z Beginneruser 11037 Localization Scribunto text/plain local export = {} local m_data = mw.loadData("Module:headword/data") local title = mw.title.getCurrentTitle() local isLemma = m_data.lemmas local isNonLemma = m_data.nonlemmas local notranslit = m_data.notranslit local toBeTagged = m_data.toBeTagged -- If set to true, categories always appear, even in non-mainspace pages local test_force_categories = false local function test_script(text, script_code) if type(text) == "string" and type(script_code) == "string" then local sc = require("Module:scripts").getByCode(script_code) local characters if sc then characters = sc:getCharacters() end local out if characters then text = mw.ustring.gsub(text, "%W", "") out = mw.ustring.find(text, "[" .. characters .. "]") end if out then return true else return false end else mw.log("Parameters to test_script were incorrect.") return nil end end local spacingPunctuation = "[%s%p]+" --[[ List of punctuation or spacing characters that are found inside of words. Used to exclude characters from the regex above. ]] local wordPunc = "-־׳״'.·*’་•" local notWordPunc = "[^" .. wordPunc .. "]+" -- Return true if the given head is multiword according to the algorithm used -- in full_headword(). function export.head_is_multiword(head) for possibleWordBreak in mw.ustring.gmatch(head, spacingPunctuation) do if mw.ustring.find(possibleWordBreak, notWordPunc) then return true end end return false end -- Add links to a multiword head. function export.add_multiword_links(head) local function workaround_to_exclude_chars(s) return mw.ustring.gsub(s, notWordPunc, "]]%1[[") end head = "[[" .. mw.ustring.gsub( head, spacingPunctuation, workaround_to_exclude_chars ) .. "]]" --[=[ use this when workaround is no longer needed: head = "[[" .. mw.ustring.gsub(head, WORDBREAKCHARS, "]]%1[[") .. "]]" Remove any empty links, which could have been created above at the beginning or end of the string. ]=] head = mw.ustring.gsub(head, "%[%[%]%]", "") return head end local function non_categorizable() return (title:inNamespace("") and title.text:find("^Unsupported titles/")) or (title:inNamespace("پیوست") and title.text:find("^Gestures/")) end local function preprocess(data, postype) --[=[ [[Special:WhatLinksHere/Template:tracking/headword/heads-not-table]] [[Special:WhatLinksHere/Template:tracking/headword/translits-not-table]] ]=] if type(data.heads) ~= "table" then if data.heads then require("Module:debug/track")("headword/heads-not-table") end data.heads = { data.heads } end if type(data.translits) ~= "table" then if data.translits then require("Module:debug/track")("headword/translits-not-table") end data.translits = { data.translits } end if type(data.transcriptions) ~= "table" then if data.transcriptions then require("Module:debug/track")("headword/transcriptions-not-table") end data.transcriptions = { data.transcriptions } end if not data.heads or #data.heads == 0 then data.heads = {""} end -- Determine if term is reconstructed local is_reconstructed = data.lang:getType() == "reconstructed" or title.nsText == "Reconstruction" -- Create a default headword. local subpagename = title.subpageText local pagename = title.text local default_head if is_reconstructed then default_head = require("Module:utilities").plain_gsub(pagename, data.lang:getCanonicalName() .. "/", "") else default_head = subpagename end local unmodified_default_head = default_head -- Add links to multi-word page names when appropriate if data.lang:getCode() ~= "zh" and (not is_reconstructed) and export.head_is_multiword(default_head) then default_head = export.add_multiword_links(default_head) end if is_reconstructed then default_head = "*" .. default_head end -- If a head is the empty string "", then replace it with the default for i, head in ipairs(data.heads) do if head == "" then head = default_head else if head == default_head and data.lang:getCanonicalName() == "English" then table.insert(data.categories, data.lang:getCanonicalName() .. " terms with redundant head parameter") end end data.heads[i] = head end -- If the first head is multiword (after removing links), maybe insert into "LANG multiword terms" if not data.nomultiwordcat and postype == "بن‌واژه" and not m_data.no_multiword_cat[data.lang:getCode()] then -- Check for spaces or hyphens, but exclude prefixes and suffixes. -- Use the pagename, not the head= value, because the latter may have extra -- junk in it, e.g. superscripted text that throws off the algorithm. local checkpattern = ".[%s%-፡]." if m_data.hyphen_not_multiword_sep[data.lang:getCode()] then -- Exclude hyphens if the data module states that they should for this language checkpattern = ".[%s፡]." end if mw.ustring.find(unmodified_default_head, checkpattern) and not non_categorizable() then table.insert(data.categories, "اصطلاح‌های چند واژه‌ای " .. data.lang:getCanonicalName()) end end --[[ Try to detect the script if it was not provided We use the first headword for this, and assume that all of them have the same script This *should* always be true, right? ]] if not data.sc then data.sc = require("Module:scripts").findBestScript(data.heads[1], data.lang) end for i, val in pairs(data.translits) do data.translits[i] = {display = val, is_manual = true} end -- Make transliterations for i, head in ipairs(data.heads) do local translit = data.translits[i] -- Try to generate a transliteration if necessary -- Generate it if the script is not Latn or similar, and if no transliteration was provided if translit and translit.display == "-" then translit = nil elseif not translit and not (data.sc:getCode():find("Latn", nil, true) or data.sc:getCode() == "Latinx" or data.sc:getCode() == "None") and (not data.sc or data.sc:getCode() ~= "Imag") then translit = data.lang:transliterate(require("Module:links").remove_links(head), data.sc) -- There is still no transliteration? -- Add the entry to a cleanup category. if not translit and not notranslit[data.lang:getCode()] then translit = "<small>transliteration needed</small>" table.insert(data.categories, "Requests for transliteration of " .. data.lang:getCanonicalName() .. " terms") end if translit then translit = {display = translit, is_manual = false} end end -- Link to the transliteration entry for languages that require this if translit and data.lang:link_tr() then translit.display = require("Module:links").full_link{ term = translit.display, lang = data.lang, sc = require("Module:scripts").getByCode("Latn"), tr = "-" } end data.translits[i] = translit end if data.id and type(data.id) ~= "string" then error("The id in the data table should be a string.") end end -- Format a headword with transliterations local function format_headword(data) local m_scriptutils = require("Module:script utilities") -- Are there non-empty transliterations? -- Need to do it this way because translit[1] might be nil while translit[2] is not local has_translits = false local has_manual_translits = false -- Format the headwords for i, head in ipairs(data.heads) do if data.translits[i] or data.transcriptions[i] then has_translits = true end if data.translits[i] and data.translits[i].is_manual or data.transcriptions[i] then has_manual_translits = true end -- Apply processing to the headword, for formatting links and such if head:find("[[", nil, true) and (not data.sc or data.sc:getCode() ~= "Imag") then head = require("Module:links").language_link({term = head, lang = data.lang}, false) end -- Add language and script wrapper if i == 1 then head = m_scriptutils.tag_text(head, data.lang, data.sc, "head", nil, data.id) else head = m_scriptutils.tag_text(head, data.lang, data.sc, "head", nil) end data.heads[i] = head end local translits_formatted = "" if has_manual_translits then -- [[Special:WhatLinksHere/Template:tracking/headword/has-manual-translit/LANG]] require("Module:debug/track")("headword/has-manual-translit/" .. data.lang:getCode()) end if has_translits then -- Format the transliterations local translits = data.translits local transcriptions = data.transcriptions if translits then -- using pairs() instead of ipairs() in case there is a gap for i, _ in pairs(translits) do if type(i) == "number" then translits[i] = m_scriptutils.tag_translit(translits[i].display, data.lang:getCode(), "head", nil, translits[i].is_manual) end end end if transcriptions then for i, _ in pairs(transcriptions) do if type(i) == "number" then transcriptions[i] = m_scriptutils.tag_transcription(transcriptions[i], data.lang:getCode(), "head") end end end for i = 1, math.max(#translits, #transcriptions) do local translits_formatted = {} table.insert(translits_formatted, translits[i] and translits[i] or "") table.insert(translits_formatted, (translits[i] and transcriptions[i]) and " " or "") table.insert(translits_formatted, transcriptions[i] and "/" .. transcriptions[i] .. "/" or "") data.translits[i] = table.concat(translits_formatted) end translits_formatted = " (" .. table.concat(data.translits, " <i>or</i> ") .. ")" local transliteration_page = mw.title.new(data.lang:getCanonicalName() .. " transliteration", "Wiktionary") if transliteration_page then local success, exists = pcall(function () return transliteration_page.exists end) if success and exists then translits_formatted = " [[Wiktionary:" .. data.lang:getCanonicalName() .. " transliteration|•]]" .. translits_formatted end end end return table.concat(data.heads, " <i>or</i> ") .. translits_formatted end local function format_genders(data) if data.genders and #data.genders > 0 then local pos_for_cat if not data.nogendercat and not m_data.no_gender_cat[data.lang:getCode()] then local pos_category = data.pos_category:gsub("^reconstructed ", "") pos_for_cat = m_data.pos_for_gender_number_cat[pos_category] end local text, cats = require("Module:gender and number").format_genders(data.genders, data.lang, pos_for_cat) for _, cat in ipairs(cats) do table.insert(data.categories, cat) end return "&nbsp;" .. text else return "" end end local function format_inflection_parts(data, parts) for key, part in ipairs(parts) do if type(part) ~= "table" then part = {term = part} end local qualifiers local reftext if part.qualifiers and #part.qualifiers > 0 then qualifiers = require("Module:qualifier").format_qualifier(part.qualifiers) .. " " -- [[Special:WhatLinksHere/Template:tracking/headword/qualifier]] require("Module:debug/track")("headword/qualifier") end if part.refs and #part.refs > 0 then local refs = {} for _, ref in ipairs(part.refs) do if type(ref) ~= "table" then ref = {text = ref} end local refargs if ref.name or ref.group then refargs = {name = ref.name, group = ref.group} end table.insert(refs, mw.getCurrentFrame():extensionTag("ref", ref.text, refargs)) end reftext = table.concat(refs) end local partaccel = part.accel local face = part.hypothetical and "hypothetical" or "bold" local nolink = part.hypothetical or part.nolink if part.label then -- There should be a better way of italicizing a label. As is, this isn't customizable. part = "<i>" .. part.label .. "</i>" else -- Convert the term into a full link -- Don't show a transliteration here, the consensus seems to be not to -- show them in headword lines to avoid clutter. part = require("Module:links").full_link( { term = not nolink and part.term or nil, alt = part.alt or (nolink and part.term or nil), lang = part.lang or data.lang, sc = part.sc or parts.sc or (not part.lang and data.sc), id = part.id, genders = part.genders, tr = part.translit or (not (parts.enable_auto_translit or data.inflections.enable_auto_translit) and "-" or nil), ts = part.transcription, accel = parts.accel or partaccel, }, face, false ) end if qualifiers then part = qualifiers .. part end if reftext then part = part .. reftext end parts[key] = part end local parts_output = "" if #parts > 0 then parts_output = " " .. table.concat(parts, " <i>or</i> ") elseif parts.request then parts_output = " <small>[please provide]</small>" .. require("Module:utilities/format_categories")( {"Requests for inflections in " .. data.lang:getCanonicalName() .. " entries"}, lang, nil, nil, data.force_cat_output or test_force_categories, data.sc ) end return "<i>" .. parts.label .. "</i>" .. parts_output end -- Format the inflections following the headword local function format_inflections(data) if data.inflections and #data.inflections > 0 then -- Format each inflection individually for key, infl in ipairs(data.inflections) do data.inflections[key] = format_inflection_parts(data, infl) end return " (" .. table.concat(data.inflections, "، ") .. ")" else return "" end end -- Return "lemma" if the given POS is a lemma, "non-lemma form" if a non-lemma form, or nil -- if unknown. The POS passed in must be in its plural form ("nouns", "prefixes", etc.). -- If you have a POS in its singular form, call pluralize() in [[Module:string utilities]] to -- pluralize it in a smart fashion that knows when to add '-s' and when to add '-es'. -- -- If `best_guess` is given and the POS is in neither the lemma nor non-lemma list, guess -- based on whether it ends in " forms"; otherwise, return nil. function export.pos_lemma_or_nonlemma(plpos, best_guess) -- Is it a lemma category? if isLemma[plpos] or isLemma[plpos:gsub("^reconstructed ", "")] then return "بن‌واژه" -- Is it a nonlemma category? elseif isNonLemma[plpos] or isNonLemma[plpos:gsub("^reconstructed ", "")] or isLemma[plpos:gsub("^mutated ", "")] or isNonLemma[plpos:gsub("^mutated ", "")] then return "شکل غیر بن‌واژه" elseif best_guess then return plpos:find(" forms$") and "شکل غیر بن‌واژه" or "بن‌واژه" else return nil end end local function show_headword_line(data) local namespace = title.nsText -- Check the namespace against the language type if namespace == "" then if data.lang:getType() == "reconstructed" then error("Entries for this language must be placed in the Reconstruction: namespace.") elseif data.lang:getType() == "appendix-constructed" then error("Entries for this language must be placed in the Appendix: namespace.") end end local tracking_categories = {} if not data.noposcat then local pos_category = data.pos_category .. " " .. data.lang:getCanonicalName() if pos_category ~= "Translingual Han characters" then table.insert(data.categories, 1, pos_category) end end if data.sccat and data.sc then table.insert(data.categories, data.pos_category .. " " .. data.lang:getCanonicalName() .. " در " .. data.sc:getDisplayForm()) end -- Is it a lemma category? local postype = export.pos_lemma_or_nonlemma(data.pos_category) if not postype then -- We don't know what this category is, so tag it with a tracking category. --[=[ [[Special:WhatLinksHere/Template:tracking/headword/unrecognized pos]] ]=] table.insert(tracking_categories, "head tracking/unrecognized pos") require("Module:debug/track"){ "headword/unrecognized pos", "headword/unrecognized pos/lang/" .. data.lang:getCode(), "headword/unrecognized pos/pos/" .. data.pos_category } elseif not data.noposcat then table.insert(data.categories, 1, postype .. "‌های " .. data.lang:getCanonicalName()) end -- Preprocess preprocess(data, postype) if namespace == "" and data.lang:getType() ~= "reconstructed" then local m_links = require("Module:links") for _, head in ipairs(data.heads) do if title.prefixedText ~= m_links.getLinkPage(m_links.remove_links(head), data.lang) then --[=[ [[Special:WhatLinksHere/Template:tracking/headword/pagename spelling mismatch]] ]=] require("Module:debug/track"){ "headword/pagename spelling mismatch", "headword/pagename spelling mismatch/" .. data.lang:getCode() } break end end end -- Format and return all the gathered information return format_headword(data) .. format_genders(data) .. format_inflections(data) .. require("Module:utilities/format_categories")( tracking_categories, data.lang, data.sort_key, nil, data.force_cat_output or test_force_categories, data.sc ) end function export.full_headword(data) local tracking_categories = {} -- Script-tags the topmost header. local pagename = title.text local fullPagename = title.fullText local namespace = title.nsText if not data.lang or type(data.lang) ~= "table" or not data.lang.getCode then error("In data, the first argument to full_headword, data.lang should be a language object.") end if not data.sc then data.sc = require("Module:scripts").findBestScript(data.heads and data.heads[1] ~= "" and data.heads[1] or pagename, data.lang) else -- Track uses of sc parameter local best = require("Module:scripts").findBestScript(pagename, data.lang) require("Module:debug/track")("headword/sc") if data.sc:getCode() == best:getCode() then require("Module:debug/track")("headword/sc/redundant") require("Module:debug/track")("headword/sc/redundant/" .. data.sc:getCode()) else require("Module:debug/track")("headword/sc/needed") require("Module:debug/track")("headword/sc/needed/" .. data.sc:getCode()) end end local displayTitle -- Assumes that the scripts in "toBeTagged" will never occur in the Reconstruction namespace. -- Avoid tagging ASCII as Hani even when it is tagged as Hani in the -- headword, as in [[check]]. The check for ASCII might need to be expanded -- to a check for any Latin characters and whitespace or punctuation. if (namespace == "" and data.sc and toBeTagged[data.sc:getCode()] and not pagename:find "^[%z\1-\127]+$") or (data.sc:getCode() == "Jpan" and (test_script(pagename, "Hira") or test_script(pagename, "Kana"))) then displayTitle = '<span class="' .. data.sc:getCode() .. '">' .. pagename .. '</span>' elseif namespace == "Reconstruction" then displayTitle, matched = mw.ustring.gsub( fullPagename, "^(Reconstruction:[^/]+/)(.+)$", function(before, term) return before .. require("Module:script utilities").tag_text( term, data.lang, data.sc ) end ) if matched == 0 then displayTitle = nil end end if displayTitle then local frame = mw.getCurrentFrame() frame:callParserFunction( "DISPLAYTITLE", displayTitle ) end if data.force_cat_output then --[=[ [[Special:WhatLinksHere/Template:tracking/headword/force cat output]] ]=] require("Module:debug/track")("headword/force cat output") end if data.getCanonicalName then error('The "data" variable supplied to "full_headword" should not be a language object.') end -- Were any categories specified? if data.categories and #data.categories > 0 then local lang_name = require("Module:string/pattern_escape")(data.lang:getCanonicalName()) for _, cat in ipairs(data.categories) do -- Does the category begin with the language name? If not, tag it with a tracking category. if not mw.ustring.find(cat, "^" .. lang_name) then mw.log(cat, data.lang:getCanonicalName()) table.insert(tracking_categories, "head tracking/no lang category") --[=[ [[Special:WhatLinksHere/Template:tracking/head tracking/no lang category]] ]=] require("Module:debug/track"){ "headword/no lang category", "headword/no lang category/lang/" .. data.lang:getCode() } end end if not data.pos_category and mw.ustring.find(data.categories[1], "^" .. data.lang:getCanonicalName()) then data.pos_category = mw.ustring.gsub(data.categories[1], "^" .. data.lang:getCanonicalName() .. " ", "") table.remove(data.categories, 1) end end if not data.pos_category then error( 'No valid part-of-speech categories were found in the list ' .. 'of categories passed to the function "full_headword". ' .. 'The part-of-speech category should consist of a language\'s ' .. 'canonical name plus a part of speech.' ) end -- Categorise for unusual characters local standard = data.lang:getStandardCharacters() if standard then if mw.ustring.len(title.subpageText) ~= 1 and not non_categorizable() then for character in mw.ustring.gmatch(title.subpageText, "([^" .. standard .. "])") do local upper = mw.ustring.upper(character) if not mw.ustring.find(upper, "[" .. standard .. "]") then character = upper end table.insert( data.categories, data.lang:getCanonicalName() .. " terms spelled with " .. character ) end end end -- Categorise for palindromes if title.nsText ~= "Reconstruction" and mw.ustring.len(title.subpageText)>2 and require('Module:palindromes').is_palindrome( title.subpageText, data.lang, data.sc ) then table.insert(data.categories, data.lang:getCanonicalName() .. " palindromes") end -- This may add more categories (e.g. gender categories), so make sure it gets -- evaluated first. local text = show_headword_line(data) return text .. require("Module:utilities/format_categories")( data.categories, data.lang, data.sort_key, nil, data.force_cat_output or test_force_categories, data.sc ) .. require("Module:utilities/format_categories")( tracking_categories, data.lang, data.sort_key, nil, data.force_cat_output or test_force_categories, data.sc ) end return export bjrmeqy5f50wvbsnjxu2i5qczfxq2mj 848382 848381 2022-08-18T15:24:47Z Beginneruser 11037 Localization Scribunto text/plain local export = {} local m_data = mw.loadData("Module:headword/data") local title = mw.title.getCurrentTitle() local isLemma = m_data.lemmas local isNonLemma = m_data.nonlemmas local notranslit = m_data.notranslit local toBeTagged = m_data.toBeTagged -- If set to true, categories always appear, even in non-mainspace pages local test_force_categories = false local function test_script(text, script_code) if type(text) == "string" and type(script_code) == "string" then local sc = require("Module:scripts").getByCode(script_code) local characters if sc then characters = sc:getCharacters() end local out if characters then text = mw.ustring.gsub(text, "%W", "") out = mw.ustring.find(text, "[" .. characters .. "]") end if out then return true else return false end else mw.log("Parameters to test_script were incorrect.") return nil end end local spacingPunctuation = "[%s%p]+" --[[ List of punctuation or spacing characters that are found inside of words. Used to exclude characters from the regex above. ]] local wordPunc = "-־׳״'.·*’་•" local notWordPunc = "[^" .. wordPunc .. "]+" -- Return true if the given head is multiword according to the algorithm used -- in full_headword(). function export.head_is_multiword(head) for possibleWordBreak in mw.ustring.gmatch(head, spacingPunctuation) do if mw.ustring.find(possibleWordBreak, notWordPunc) then return true end end return false end -- Add links to a multiword head. function export.add_multiword_links(head) local function workaround_to_exclude_chars(s) return mw.ustring.gsub(s, notWordPunc, "]]%1[[") end head = "[[" .. mw.ustring.gsub( head, spacingPunctuation, workaround_to_exclude_chars ) .. "]]" --[=[ use this when workaround is no longer needed: head = "[[" .. mw.ustring.gsub(head, WORDBREAKCHARS, "]]%1[[") .. "]]" Remove any empty links, which could have been created above at the beginning or end of the string. ]=] head = mw.ustring.gsub(head, "%[%[%]%]", "") return head end local function non_categorizable() return (title:inNamespace("") and title.text:find("^Unsupported titles/")) or (title:inNamespace("پیوست") and title.text:find("^Gestures/")) end local function preprocess(data, postype) --[=[ [[Special:WhatLinksHere/Template:tracking/headword/heads-not-table]] [[Special:WhatLinksHere/Template:tracking/headword/translits-not-table]] ]=] if type(data.heads) ~= "table" then if data.heads then require("Module:debug/track")("headword/heads-not-table") end data.heads = { data.heads } end if type(data.translits) ~= "table" then if data.translits then require("Module:debug/track")("headword/translits-not-table") end data.translits = { data.translits } end if type(data.transcriptions) ~= "table" then if data.transcriptions then require("Module:debug/track")("headword/transcriptions-not-table") end data.transcriptions = { data.transcriptions } end if not data.heads or #data.heads == 0 then data.heads = {""} end -- Determine if term is reconstructed local is_reconstructed = data.lang:getType() == "reconstructed" or title.nsText == "Reconstruction" -- Create a default headword. local subpagename = title.subpageText local pagename = title.text local default_head if is_reconstructed then default_head = require("Module:utilities").plain_gsub(pagename, data.lang:getCanonicalName() .. "/", "") else default_head = subpagename end local unmodified_default_head = default_head -- Add links to multi-word page names when appropriate if data.lang:getCode() ~= "zh" and (not is_reconstructed) and export.head_is_multiword(default_head) then default_head = export.add_multiword_links(default_head) end if is_reconstructed then default_head = "*" .. default_head end -- If a head is the empty string "", then replace it with the default for i, head in ipairs(data.heads) do if head == "" then head = default_head else if head == default_head and data.lang:getCanonicalName() == "English" then table.insert(data.categories, data.lang:getCanonicalName() .. " terms with redundant head parameter") end end data.heads[i] = head end -- If the first head is multiword (after removing links), maybe insert into "LANG multiword terms" if not data.nomultiwordcat and postype == "بن‌واژه" and not m_data.no_multiword_cat[data.lang:getCode()] then -- Check for spaces or hyphens, but exclude prefixes and suffixes. -- Use the pagename, not the head= value, because the latter may have extra -- junk in it, e.g. superscripted text that throws off the algorithm. local checkpattern = ".[%s%-፡]." if m_data.hyphen_not_multiword_sep[data.lang:getCode()] then -- Exclude hyphens if the data module states that they should for this language checkpattern = ".[%s፡]." end if mw.ustring.find(unmodified_default_head, checkpattern) and not non_categorizable() then table.insert(data.categories, "اصطلاح‌های چند واژه‌ای " .. data.lang:getCanonicalName()) end end --[[ Try to detect the script if it was not provided We use the first headword for this, and assume that all of them have the same script This *should* always be true, right? ]] if not data.sc then data.sc = require("Module:scripts").findBestScript(data.heads[1], data.lang) end for i, val in pairs(data.translits) do data.translits[i] = {display = val, is_manual = true} end -- Make transliterations for i, head in ipairs(data.heads) do local translit = data.translits[i] -- Try to generate a transliteration if necessary -- Generate it if the script is not Latn or similar, and if no transliteration was provided if translit and translit.display == "-" then translit = nil elseif not translit and not (data.sc:getCode():find("Latn", nil, true) or data.sc:getCode() == "Latinx" or data.sc:getCode() == "None") and (not data.sc or data.sc:getCode() ~= "Imag") then translit = data.lang:transliterate(require("Module:links").remove_links(head), data.sc) -- There is still no transliteration? -- Add the entry to a cleanup category. if not translit and not notranslit[data.lang:getCode()] then translit = "<small>transliteration needed</small>" table.insert(data.categories, "Requests for transliteration of " .. data.lang:getCanonicalName() .. " terms") end if translit then translit = {display = translit, is_manual = false} end end -- Link to the transliteration entry for languages that require this if translit and data.lang:link_tr() then translit.display = require("Module:links").full_link{ term = translit.display, lang = data.lang, sc = require("Module:scripts").getByCode("Latn"), tr = "-" } end data.translits[i] = translit end if data.id and type(data.id) ~= "string" then error("The id in the data table should be a string.") end end -- Format a headword with transliterations local function format_headword(data) local m_scriptutils = require("Module:script utilities") -- Are there non-empty transliterations? -- Need to do it this way because translit[1] might be nil while translit[2] is not local has_translits = false local has_manual_translits = false -- Format the headwords for i, head in ipairs(data.heads) do if data.translits[i] or data.transcriptions[i] then has_translits = true end if data.translits[i] and data.translits[i].is_manual or data.transcriptions[i] then has_manual_translits = true end -- Apply processing to the headword, for formatting links and such if head:find("[[", nil, true) and (not data.sc or data.sc:getCode() ~= "Imag") then head = require("Module:links").language_link({term = head, lang = data.lang}, false) end -- Add language and script wrapper if i == 1 then head = m_scriptutils.tag_text(head, data.lang, data.sc, "head", nil, data.id) else head = m_scriptutils.tag_text(head, data.lang, data.sc, "head", nil) end data.heads[i] = head end local translits_formatted = "" if has_manual_translits then -- [[Special:WhatLinksHere/Template:tracking/headword/has-manual-translit/LANG]] require("Module:debug/track")("headword/has-manual-translit/" .. data.lang:getCode()) end if has_translits then -- Format the transliterations local translits = data.translits local transcriptions = data.transcriptions if translits then -- using pairs() instead of ipairs() in case there is a gap for i, _ in pairs(translits) do if type(i) == "number" then translits[i] = m_scriptutils.tag_translit(translits[i].display, data.lang:getCode(), "head", nil, translits[i].is_manual) end end end if transcriptions then for i, _ in pairs(transcriptions) do if type(i) == "number" then transcriptions[i] = m_scriptutils.tag_transcription(transcriptions[i], data.lang:getCode(), "head") end end end for i = 1, math.max(#translits, #transcriptions) do local translits_formatted = {} table.insert(translits_formatted, translits[i] and translits[i] or "") table.insert(translits_formatted, (translits[i] and transcriptions[i]) and " " or "") table.insert(translits_formatted, transcriptions[i] and "/" .. transcriptions[i] .. "/" or "") data.translits[i] = table.concat(translits_formatted) end translits_formatted = " (" .. table.concat(data.translits, " <i>یا</i> ") .. ")" local transliteration_page = mw.title.new(data.lang:getCanonicalName() .. " transliteration", "Wiktionary") if transliteration_page then local success, exists = pcall(function () return transliteration_page.exists end) if success and exists then translits_formatted = " [[Wiktionary:" .. data.lang:getCanonicalName() .. " transliteration|•]]" .. translits_formatted end end end return table.concat(data.heads, " <i>یا</i> ") .. translits_formatted end local function format_genders(data) if data.genders and #data.genders > 0 then local pos_for_cat if not data.nogendercat and not m_data.no_gender_cat[data.lang:getCode()] then local pos_category = data.pos_category:gsub("^reconstructed ", "") pos_for_cat = m_data.pos_for_gender_number_cat[pos_category] end local text, cats = require("Module:gender and number").format_genders(data.genders, data.lang, pos_for_cat) for _, cat in ipairs(cats) do table.insert(data.categories, cat) end return "&nbsp;" .. text else return "" end end local function format_inflection_parts(data, parts) for key, part in ipairs(parts) do if type(part) ~= "table" then part = {term = part} end local qualifiers local reftext if part.qualifiers and #part.qualifiers > 0 then qualifiers = require("Module:qualifier").format_qualifier(part.qualifiers) .. " " -- [[Special:WhatLinksHere/Template:tracking/headword/qualifier]] require("Module:debug/track")("headword/qualifier") end if part.refs and #part.refs > 0 then local refs = {} for _, ref in ipairs(part.refs) do if type(ref) ~= "table" then ref = {text = ref} end local refargs if ref.name or ref.group then refargs = {name = ref.name, group = ref.group} end table.insert(refs, mw.getCurrentFrame():extensionTag("ref", ref.text, refargs)) end reftext = table.concat(refs) end local partaccel = part.accel local face = part.hypothetical and "hypothetical" or "bold" local nolink = part.hypothetical or part.nolink if part.label then -- There should be a better way of italicizing a label. As is, this isn't customizable. part = "<i>" .. part.label .. "</i>" else -- Convert the term into a full link -- Don't show a transliteration here, the consensus seems to be not to -- show them in headword lines to avoid clutter. part = require("Module:links").full_link( { term = not nolink and part.term or nil, alt = part.alt or (nolink and part.term or nil), lang = part.lang or data.lang, sc = part.sc or parts.sc or (not part.lang and data.sc), id = part.id, genders = part.genders, tr = part.translit or (not (parts.enable_auto_translit or data.inflections.enable_auto_translit) and "-" or nil), ts = part.transcription, accel = parts.accel or partaccel, }, face, false ) end if qualifiers then part = qualifiers .. part end if reftext then part = part .. reftext end parts[key] = part end local parts_output = "" if #parts > 0 then parts_output = " " .. table.concat(parts, " <i>یا</i> ") elseif parts.request then parts_output = " <small>[please provide]</small>" .. require("Module:utilities/format_categories")( {"Requests for inflections in " .. data.lang:getCanonicalName() .. " entries"}, lang, nil, nil, data.force_cat_output or test_force_categories, data.sc ) end return "<i>" .. parts.label .. "</i>" .. parts_output end -- Format the inflections following the headword local function format_inflections(data) if data.inflections and #data.inflections > 0 then -- Format each inflection individually for key, infl in ipairs(data.inflections) do data.inflections[key] = format_inflection_parts(data, infl) end return " (" .. table.concat(data.inflections, "، ") .. ")" else return "" end end -- Return "lemma" if the given POS is a lemma, "non-lemma form" if a non-lemma form, or nil -- if unknown. The POS passed in must be in its plural form ("nouns", "prefixes", etc.). -- If you have a POS in its singular form, call pluralize() in [[Module:string utilities]] to -- pluralize it in a smart fashion that knows when to add '-s' and when to add '-es'. -- -- If `best_guess` is given and the POS is in neither the lemma nor non-lemma list, guess -- based on whether it ends in " forms"; otherwise, return nil. function export.pos_lemma_or_nonlemma(plpos, best_guess) -- Is it a lemma category? if isLemma[plpos] or isLemma[plpos:gsub("^reconstructed ", "")] then return "بن‌واژه" -- Is it a nonlemma category? elseif isNonLemma[plpos] or isNonLemma[plpos:gsub("^reconstructed ", "")] or isLemma[plpos:gsub("^mutated ", "")] or isNonLemma[plpos:gsub("^mutated ", "")] then return "شکل غیر بن‌واژه" elseif best_guess then return plpos:find(" forms$") and "شکل غیر بن‌واژه" or "بن‌واژه" else return nil end end local function show_headword_line(data) local namespace = title.nsText -- Check the namespace against the language type if namespace == "" then if data.lang:getType() == "reconstructed" then error("Entries for this language must be placed in the Reconstruction: namespace.") elseif data.lang:getType() == "appendix-constructed" then error("Entries for this language must be placed in the Appendix: namespace.") end end local tracking_categories = {} if not data.noposcat then local pos_category = data.pos_category .. " " .. data.lang:getCanonicalName() if pos_category ~= "Translingual Han characters" then table.insert(data.categories, 1, pos_category) end end if data.sccat and data.sc then table.insert(data.categories, data.pos_category .. " " .. data.lang:getCanonicalName() .. " در " .. data.sc:getDisplayForm()) end -- Is it a lemma category? local postype = export.pos_lemma_or_nonlemma(data.pos_category) if not postype then -- We don't know what this category is, so tag it with a tracking category. --[=[ [[Special:WhatLinksHere/Template:tracking/headword/unrecognized pos]] ]=] table.insert(tracking_categories, "head tracking/unrecognized pos") require("Module:debug/track"){ "headword/unrecognized pos", "headword/unrecognized pos/lang/" .. data.lang:getCode(), "headword/unrecognized pos/pos/" .. data.pos_category } elseif not data.noposcat then table.insert(data.categories, 1, postype .. "‌های " .. data.lang:getCanonicalName()) end -- Preprocess preprocess(data, postype) if namespace == "" and data.lang:getType() ~= "reconstructed" then local m_links = require("Module:links") for _, head in ipairs(data.heads) do if title.prefixedText ~= m_links.getLinkPage(m_links.remove_links(head), data.lang) then --[=[ [[Special:WhatLinksHere/Template:tracking/headword/pagename spelling mismatch]] ]=] require("Module:debug/track"){ "headword/pagename spelling mismatch", "headword/pagename spelling mismatch/" .. data.lang:getCode() } break end end end -- Format and return all the gathered information return format_headword(data) .. format_genders(data) .. format_inflections(data) .. require("Module:utilities/format_categories")( tracking_categories, data.lang, data.sort_key, nil, data.force_cat_output or test_force_categories, data.sc ) end function export.full_headword(data) local tracking_categories = {} -- Script-tags the topmost header. local pagename = title.text local fullPagename = title.fullText local namespace = title.nsText if not data.lang or type(data.lang) ~= "table" or not data.lang.getCode then error("In data, the first argument to full_headword, data.lang should be a language object.") end if not data.sc then data.sc = require("Module:scripts").findBestScript(data.heads and data.heads[1] ~= "" and data.heads[1] or pagename, data.lang) else -- Track uses of sc parameter local best = require("Module:scripts").findBestScript(pagename, data.lang) require("Module:debug/track")("headword/sc") if data.sc:getCode() == best:getCode() then require("Module:debug/track")("headword/sc/redundant") require("Module:debug/track")("headword/sc/redundant/" .. data.sc:getCode()) else require("Module:debug/track")("headword/sc/needed") require("Module:debug/track")("headword/sc/needed/" .. data.sc:getCode()) end end local displayTitle -- Assumes that the scripts in "toBeTagged" will never occur in the Reconstruction namespace. -- Avoid tagging ASCII as Hani even when it is tagged as Hani in the -- headword, as in [[check]]. The check for ASCII might need to be expanded -- to a check for any Latin characters and whitespace or punctuation. if (namespace == "" and data.sc and toBeTagged[data.sc:getCode()] and not pagename:find "^[%z\1-\127]+$") or (data.sc:getCode() == "Jpan" and (test_script(pagename, "Hira") or test_script(pagename, "Kana"))) then displayTitle = '<span class="' .. data.sc:getCode() .. '">' .. pagename .. '</span>' elseif namespace == "Reconstruction" then displayTitle, matched = mw.ustring.gsub( fullPagename, "^(Reconstruction:[^/]+/)(.+)$", function(before, term) return before .. require("Module:script utilities").tag_text( term, data.lang, data.sc ) end ) if matched == 0 then displayTitle = nil end end if displayTitle then local frame = mw.getCurrentFrame() frame:callParserFunction( "DISPLAYTITLE", displayTitle ) end if data.force_cat_output then --[=[ [[Special:WhatLinksHere/Template:tracking/headword/force cat output]] ]=] require("Module:debug/track")("headword/force cat output") end if data.getCanonicalName then error('The "data" variable supplied to "full_headword" should not be a language object.') end -- Were any categories specified? if data.categories and #data.categories > 0 then local lang_name = require("Module:string/pattern_escape")(data.lang:getCanonicalName()) for _, cat in ipairs(data.categories) do -- Does the category begin with the language name? If not, tag it with a tracking category. if not mw.ustring.find(cat, "^" .. lang_name) then mw.log(cat, data.lang:getCanonicalName()) table.insert(tracking_categories, "head tracking/no lang category") --[=[ [[Special:WhatLinksHere/Template:tracking/head tracking/no lang category]] ]=] require("Module:debug/track"){ "headword/no lang category", "headword/no lang category/lang/" .. data.lang:getCode() } end end if not data.pos_category and mw.ustring.find(data.categories[1], "^" .. data.lang:getCanonicalName()) then data.pos_category = mw.ustring.gsub(data.categories[1], "^" .. data.lang:getCanonicalName() .. " ", "") table.remove(data.categories, 1) end end if not data.pos_category then error( 'No valid part-of-speech categories were found in the list ' .. 'of categories passed to the function "full_headword". ' .. 'The part-of-speech category should consist of a language\'s ' .. 'canonical name plus a part of speech.' ) end -- Categorise for unusual characters local standard = data.lang:getStandardCharacters() if standard then if mw.ustring.len(title.subpageText) ~= 1 and not non_categorizable() then for character in mw.ustring.gmatch(title.subpageText, "([^" .. standard .. "])") do local upper = mw.ustring.upper(character) if not mw.ustring.find(upper, "[" .. standard .. "]") then character = upper end table.insert( data.categories, data.lang:getCanonicalName() .. " terms spelled with " .. character ) end end end -- Categorise for palindromes if title.nsText ~= "Reconstruction" and mw.ustring.len(title.subpageText)>2 and require('Module:palindromes').is_palindrome( title.subpageText, data.lang, data.sc ) then table.insert(data.categories, data.lang:getCanonicalName() .. " palindromes") end -- This may add more categories (e.g. gender categories), so make sure it gets -- evaluated first. local text = show_headword_line(data) return text .. require("Module:utilities/format_categories")( data.categories, data.lang, data.sort_key, nil, data.force_cat_output or test_force_categories, data.sc ) .. require("Module:utilities/format_categories")( tracking_categories, data.lang, data.sort_key, nil, data.force_cat_output or test_force_categories, data.sc ) end return export gu1v2ox8xj1f8bg0wgm60c6wpa74v2z استفایشتن 0 190433 848395 848121 2022-08-19T02:28:41Z HAKHSIN 4580 پیراستن wikitext text/x-wiki ==فارسی== ===مصدر=== * [اِسْتِفایِشْتَنْ] <small>[[استفادن|استفای]] + [[-شتن|ـشتن]]</small> # [[مصدر مجهول]] [[استفادن]]؛ [[استفاده شدن]]: #: همه‌ی کتاب‌ها استفایشتند (استفاده شدند). #: نه! همه‌اشان استفایشند. [[رده:مصدر فارسی]] [[رده:مصدر فارسی ساده]] [[رده:مصدر فارسی مجهول]] ====فعل==== {{فعل-فا}} {{گردانش فارسی|استفایشتن|استفایشت|استفایش}} 0d01n9nyr6bmxpxnklr4icz2wnik0tx بیانیدن 0 192292 848396 845586 2022-08-19T02:34:17Z HAKHSIN 4580 پیراستن wikitext text/x-wiki ==فارسی== ===مصدر=== * /بَیانیدَنْ/ <small>[[بیان]] + [[-یدن|ـیدن]]</small> # فرایند [[گفتن]] یا [[نوشتن]] [[یه]] مطلب: #: بیانیدن مشکل‌های دیگران در هر جمعی خوب نیست. [[رده:مصدر فارسی]] [[رده:مصدر فارسی ساده]] [[رده:مصدر فارسی گزاری]] [[رده:مصدر فارسی گذرا]] ===فعل=== {{فعل-فا}} * /بَیانیدَنْ/ # [[مطلب|مطلبی]] را [[گفتن]]/[[نوشتن]]؛ مطلبی را درقالب واژگان [[نمودن]]: #: مشکل خودرو [[هه]] را برایمان بیانید. #: طرز کار دستگاه [[هه]] را برایم بیانید. {{گردانش فارسی|بیانیدن|بیانید|بیان}} ====برگردان==== {{برگردان-بالا|نمودن با واژگان}} * انگلیسی: {{t+|en|describe}} {{برگردان-پایین}} o42qyuqu46o29zml3ki8e08gd7p68af ابوالفضل امیری (خواننده رپ و بازیگر) 0 193004 848386 848078 2022-08-18T18:10:28Z 5.218.85.94 افزودن مطلب wikitext text/x-wiki {{حذف سریع|خارج از محدوده پروژه}} ابوالفضل امیری خواننده رپ و بازیگر کورد-فارس اهل کاشان متولد 15 April 1995 ، ۲۶ فروردین ۱۳۷۴ هجری شمسی در شهر کاشان هست. {{دست نگهدار}} این فرد یک هنرمند مشهور و محبوب شناخته شده اینترنتی است و آهنگ هایش طرفدار زیادی در ایران دارند و در چند فیلم سینمایی هم بازی و ایفای نقش کرده است. suyj1skye56t7m9io3pn6eoh25x1nuv 848398 848386 2022-08-19T02:36:21Z HAKHSIN 4580 ویرایش [[Special:Contributions/5.218.85.94|5.218.85.94]] ([[User talk:5.218.85.94|بحث]]) به آخرین تغییری که [[User:Beginneruser|Beginneruser]] انجام داده بود واگردانده شد wikitext text/x-wiki {{حذف سریع|خارج از محدوده پروژه}} ابوالفضل امیری خواننده رپ و بازیگر کورد-فارس اهل کاشان متولد 15 April 1995 ، ۲۶ فروردین ۱۳۷۴ هجری شمسی در شهر کاشان هست. 7pegod6lu275cf6gyehk6hc5zgmkuod کانازاوا 0 193470 848372 2022-08-18T14:41:29Z 5.124.232.202 صفحه‌ای تازه حاوی « هیروکازو کانازاوا (金澤 弘和، کانازاوا هیروکازو، ۳ مه ۱۹۳۱ - ۸ دسامبر ۲۰۱۹)[1] معلم ژاپنی کاراته شوتوکان بود.[2][3][4] او مربی ارشد و رئیس فدراسیون بین المللی کاراته شوتوکان بود، سازمانی که پس از ترک انجمن کاراته ژاپن (JKA) تأسیس کرد. کانازاوا در شوتوکا...» ایجاد کرد wikitext text/x-wiki هیروکازو کانازاوا (金澤 弘和، کانازاوا هیروکازو، ۳ مه ۱۹۳۱ - ۸ دسامبر ۲۰۱۹)[1] معلم ژاپنی کاراته شوتوکان بود.[2][3][4] او مربی ارشد و رئیس فدراسیون بین المللی کاراته شوتوکان بود، سازمانی که پس از ترک انجمن کاراته ژاپن (JKA) تأسیس کرد. کانازاوا در شوتوکان کاراته رتبه دهم دان را کسب کرد.[4] هیروکازو کانازاوا متولد 3 مه 1931 استان ایواته، ژاپن در 8 دسامبر 2019 فوت کرد (88 ساله) سبک شوتوکان کاراته، جودو، معلم(های) گیچین فوناکوشی، ماساتوشی ناکایاما رتبه دهم cygtgp1tbjooa1g9huy1kweci2fzdvf بحث کاربر:Bobouh 3 193471 848383 2022-08-18T16:14:22Z پیام به کاربر جدید 26498 افزودن [[الگو:خوشامدید|پیام خوش‌آمد]] به صفحهٔ بحث کاربر تازه wikitext text/x-wiki == خوش آمدید == [[ویکی‌واژه:تازه‌واردان، خوش آمدید|'''به ویکی‌واژه خوش‌آمدید''']]!<br /> امیدوارم حضوری طولانی مدت در ویکی‌واژه داشته باشید و بتوانیم با همکاری یکدیگر در جهت پیشرفت هر چه بیشتر این وبگاه گام برداریم. ویکی‌واژه منتظر نوشتارهای خوب شماست.<br /> این پیوندها می‌تواند سودمند باشد: {| |- |[[پرونده:Noia 64 apps help index.png|30px|right|link=ویکی‌واژه:راهنما|راهنما]] || [[ویکی‌واژه:راهنما|راهنما]] برای راهنمایی گرفتن |- | [[پرونده:Nuvola apps ksig.png|30px|right|link=ویکی‌واژه:آموزش سریع|آموزش سریع]] || [[ویکی‌واژه:آموزش سریع|آموزش سریع]] |- |||[[راهنما:افزودن سرواژه نو|افزودن سرواژهٔ نو]] راهنمای افزودن سرواژهٔ نو |- |||[[ویکی‌واژه:شیوه‌نامه|شیوه‌نامه]] شیوه‌نامهٔ ویکی‌واژه |- |[[File:Bucket in the sand.svg|right|50px]]||[[ویکی‌واژه:صفحه تمرین|صفحه تمرین]] برای تمرین ویرایش |- | [[پرونده:Nuvola apps chat.png|30px|right|link=ویکی‌واژه:قهوه‌خانه|قهوه‌خانه]]||[[ویکی‌واژه:قهوه‌خانه|قهوه‌خانه]] برای گفتگو دربارهٔ مسائل فنی و سیاست‌ها. |- |[[پرونده:Farsi.svg|30px|right|link=ویکی‌واژه:فارسی‌نویسی|فارسی‌نویسی]]||[[ویکی‌واژه:فارسی‌نویسی|فارسی‌نویسی]] |- |[[پرونده:Nuvola apps agent.svg|30px|right|link=w:ویکی‌پدیا:خودآموز|آموزش پیشرفته]]||[[w:ویکی‌پدیا:خودآموز|آموزش پیشرفته]] |- | |- | |- |'''پروژه‌های دیگر بنیاد'''||[[پرونده:Wikipedia-logo.png|25px|link=w:صفحه_اصلی|ویکی‌پدیا]][[پرونده:HSWikimedia.svg|30px|link=m:Special:Recentchanges|فراویکی]] [[پرونده:HSCommons.svg|30px|link=commons:Special:Recentchanges|ویکی‌انبار]][[پرونده:HSWNews.svg|30px|link=n:ویژه:تغییرات اخیر|ویکی‌خبر]] [[پرونده:HSWBooks.svg|30px|link=b:صفحه_اصلی|ویکی‌نَسک]] [[پرونده:HSWVoyage.svg|30px|link=voy:صفحه_اصلی|ویکی‌سفر]][[پرونده:HSWQuote.svg|30px|link=q:صفحه_اصلی|ویکی‌گفتاورد]][[پرونده:HSWSource.svg|30px|link=s:صفحه_اصلی|ویکی‌نبشته]] |} امیدوارم از ''[[ویکی‌واژه:ویکی‌واژه نویسان|ویکی‌واژه نویس]]'' بودن لذت ببرید! لطفاً در صفحات گفتگو نام خود را با چهار علامت مدک امضا کنید، (~&#126;~~)، با این کار نام شما و تاریخ به عنوان امضا درج خواهد شد. در صورتی که سوال داشتید، به صفحهٔ [[ویکی‌واژه:قهوه‌خانه|قهوه‌خانه]] بروید، یا اینکه از من در صفحهٔ بحثم بپرسید. باز هم خوش آمد می‌گویم!&nbsp;شاد باشید! -- [[کاربر:AFlorence|'''فلورانس''']] ([[بحث کاربر:AFlorence|بحث]]) ‏۱۸ اوت ۲۰۲۲، ساعت ۱۶:۱۴ (UTC) 3bse7yxth30dynhd5fhi1ar8u0s40ju بحث کاربر:Rambod69 3 193472 848384 2022-08-18T17:09:11Z پیام به کاربر جدید 26498 افزودن [[الگو:خوشامدید|پیام خوش‌آمد]] به صفحهٔ بحث کاربر تازه wikitext text/x-wiki == خوش آمدید == [[ویکی‌واژه:تازه‌واردان، خوش آمدید|'''به ویکی‌واژه خوش‌آمدید''']]!<br /> امیدوارم حضوری طولانی مدت در ویکی‌واژه داشته باشید و بتوانیم با همکاری یکدیگر در جهت پیشرفت هر چه بیشتر این وبگاه گام برداریم. ویکی‌واژه منتظر نوشتارهای خوب شماست.<br /> این پیوندها می‌تواند سودمند باشد: {| |- |[[پرونده:Noia 64 apps help index.png|30px|right|link=ویکی‌واژه:راهنما|راهنما]] || [[ویکی‌واژه:راهنما|راهنما]] برای راهنمایی گرفتن |- | [[پرونده:Nuvola apps ksig.png|30px|right|link=ویکی‌واژه:آموزش سریع|آموزش سریع]] || [[ویکی‌واژه:آموزش سریع|آموزش سریع]] |- |||[[راهنما:افزودن سرواژه نو|افزودن سرواژهٔ نو]] راهنمای افزودن سرواژهٔ نو |- |||[[ویکی‌واژه:شیوه‌نامه|شیوه‌نامه]] شیوه‌نامهٔ ویکی‌واژه |- |[[File:Bucket in the sand.svg|right|50px]]||[[ویکی‌واژه:صفحه تمرین|صفحه تمرین]] برای تمرین ویرایش |- | [[پرونده:Nuvola apps chat.png|30px|right|link=ویکی‌واژه:قهوه‌خانه|قهوه‌خانه]]||[[ویکی‌واژه:قهوه‌خانه|قهوه‌خانه]] برای گفتگو دربارهٔ مسائل فنی و سیاست‌ها. |- |[[پرونده:Farsi.svg|30px|right|link=ویکی‌واژه:فارسی‌نویسی|فارسی‌نویسی]]||[[ویکی‌واژه:فارسی‌نویسی|فارسی‌نویسی]] |- |[[پرونده:Nuvola apps agent.svg|30px|right|link=w:ویکی‌پدیا:خودآموز|آموزش پیشرفته]]||[[w:ویکی‌پدیا:خودآموز|آموزش پیشرفته]] |- | |- | |- |'''پروژه‌های دیگر بنیاد'''||[[پرونده:Wikipedia-logo.png|25px|link=w:صفحه_اصلی|ویکی‌پدیا]][[پرونده:HSWikimedia.svg|30px|link=m:Special:Recentchanges|فراویکی]] [[پرونده:HSCommons.svg|30px|link=commons:Special:Recentchanges|ویکی‌انبار]][[پرونده:HSWNews.svg|30px|link=n:ویژه:تغییرات اخیر|ویکی‌خبر]] [[پرونده:HSWBooks.svg|30px|link=b:صفحه_اصلی|ویکی‌نَسک]] [[پرونده:HSWVoyage.svg|30px|link=voy:صفحه_اصلی|ویکی‌سفر]][[پرونده:HSWQuote.svg|30px|link=q:صفحه_اصلی|ویکی‌گفتاورد]][[پرونده:HSWSource.svg|30px|link=s:صفحه_اصلی|ویکی‌نبشته]] |} امیدوارم از ''[[ویکی‌واژه:ویکی‌واژه نویسان|ویکی‌واژه نویس]]'' بودن لذت ببرید! لطفاً در صفحات گفتگو نام خود را با چهار علامت مدک امضا کنید، (~&#126;~~)، با این کار نام شما و تاریخ به عنوان امضا درج خواهد شد. در صورتی که سوال داشتید، به صفحهٔ [[ویکی‌واژه:قهوه‌خانه|قهوه‌خانه]] بروید، یا اینکه از من در صفحهٔ بحثم بپرسید. باز هم خوش آمد می‌گویم!&nbsp;شاد باشید! -- [[کاربر:AFlorence|'''فلورانس''']] ([[بحث کاربر:AFlorence|بحث]]) ‏۱۸ اوت ۲۰۲۲، ساعت ۱۷:۰۹ (UTC) 926zyd7waxfusxt823imv8ob6529l8y پهلوان حسن دامغانی 0 193473 848387 2022-08-18T20:32:46Z 5.114.5.231 صفحه‌ای تازه حاوی «اون یک پهلوان جقی بود ک جق را می‌زد و کف دوست داشت» ایجاد کرد wikitext text/x-wiki اون یک پهلوان جقی بود ک جق را می‌زد و کف دوست داشت 3bzjmjjd4i3a6f5gd4j9826udqyc9nd بحث کاربر:Negar10 3 193474 848388 2022-08-18T21:15:30Z پیام به کاربر جدید 26498 افزودن [[الگو:خوشامدید|پیام خوش‌آمد]] به صفحهٔ بحث کاربر تازه wikitext text/x-wiki == خوش آمدید == [[ویکی‌واژه:تازه‌واردان، خوش آمدید|'''به ویکی‌واژه خوش‌آمدید''']]!<br /> امیدوارم حضوری طولانی مدت در ویکی‌واژه داشته باشید و بتوانیم با همکاری یکدیگر در جهت پیشرفت هر چه بیشتر این وبگاه گام برداریم. ویکی‌واژه منتظر نوشتارهای خوب شماست.<br /> این پیوندها می‌تواند سودمند باشد: {| |- |[[پرونده:Noia 64 apps help index.png|30px|right|link=ویکی‌واژه:راهنما|راهنما]] || [[ویکی‌واژه:راهنما|راهنما]] برای راهنمایی گرفتن |- | [[پرونده:Nuvola apps ksig.png|30px|right|link=ویکی‌واژه:آموزش سریع|آموزش سریع]] || [[ویکی‌واژه:آموزش سریع|آموزش سریع]] |- |||[[راهنما:افزودن سرواژه نو|افزودن سرواژهٔ نو]] راهنمای افزودن سرواژهٔ نو |- |||[[ویکی‌واژه:شیوه‌نامه|شیوه‌نامه]] شیوه‌نامهٔ ویکی‌واژه |- |[[File:Bucket in the sand.svg|right|50px]]||[[ویکی‌واژه:صفحه تمرین|صفحه تمرین]] برای تمرین ویرایش |- | [[پرونده:Nuvola apps chat.png|30px|right|link=ویکی‌واژه:قهوه‌خانه|قهوه‌خانه]]||[[ویکی‌واژه:قهوه‌خانه|قهوه‌خانه]] برای گفتگو دربارهٔ مسائل فنی و سیاست‌ها. |- |[[پرونده:Farsi.svg|30px|right|link=ویکی‌واژه:فارسی‌نویسی|فارسی‌نویسی]]||[[ویکی‌واژه:فارسی‌نویسی|فارسی‌نویسی]] |- |[[پرونده:Nuvola apps agent.svg|30px|right|link=w:ویکی‌پدیا:خودآموز|آموزش پیشرفته]]||[[w:ویکی‌پدیا:خودآموز|آموزش پیشرفته]] |- | |- | |- |'''پروژه‌های دیگر بنیاد'''||[[پرونده:Wikipedia-logo.png|25px|link=w:صفحه_اصلی|ویکی‌پدیا]][[پرونده:HSWikimedia.svg|30px|link=m:Special:Recentchanges|فراویکی]] [[پرونده:HSCommons.svg|30px|link=commons:Special:Recentchanges|ویکی‌انبار]][[پرونده:HSWNews.svg|30px|link=n:ویژه:تغییرات اخیر|ویکی‌خبر]] [[پرونده:HSWBooks.svg|30px|link=b:صفحه_اصلی|ویکی‌نَسک]] [[پرونده:HSWVoyage.svg|30px|link=voy:صفحه_اصلی|ویکی‌سفر]][[پرونده:HSWQuote.svg|30px|link=q:صفحه_اصلی|ویکی‌گفتاورد]][[پرونده:HSWSource.svg|30px|link=s:صفحه_اصلی|ویکی‌نبشته]] |} امیدوارم از ''[[ویکی‌واژه:ویکی‌واژه نویسان|ویکی‌واژه نویس]]'' بودن لذت ببرید! لطفاً در صفحات گفتگو نام خود را با چهار علامت مدک امضا کنید، (~&#126;~~)، با این کار نام شما و تاریخ به عنوان امضا درج خواهد شد. در صورتی که سوال داشتید، به صفحهٔ [[ویکی‌واژه:قهوه‌خانه|قهوه‌خانه]] بروید، یا اینکه از من در صفحهٔ بحثم بپرسید. باز هم خوش آمد می‌گویم!&nbsp;شاد باشید! -- [[کاربر:AFlorence|'''فلورانس''']] ([[بحث کاربر:AFlorence|بحث]]) ‏۱۸ اوت ۲۰۲۲، ساعت ۲۱:۱۵ (UTC) j1pccfu1xum55to2t6qhujdv1o48ly8 حسین کمال آبادی 0 193475 848389 2022-08-18T21:27:08Z Negar10 35094 صفحه‌ای تازه حاوی «[[پرونده:حسین کمال آبادی.jpg|بندانگشتی|220px|چپ|حسین کمال آبادی]] ==فارسی== ===ریشه لغت=== ایرانی - عربی ===آوایش=== */کمال آبادی/ ===[[file:Nuvola apps bookcase2.png|40px]] اسم=== '''کمال آبادی''' #منسوب به کمال آباد، با صفا، زیبا #لقب و کنیه پویانمای پارسی‌. رده:اصطلاحات ویژه ا...» ایجاد کرد wikitext text/x-wiki [[پرونده:حسین کمال آبادی.jpg|بندانگشتی|220px|چپ|حسین کمال آبادی]] ==فارسی== ===ریشه لغت=== ایرانی - عربی ===آوایش=== */کمال آبادی/ ===[[file:Nuvola apps bookcase2.png|40px]] اسم=== '''کمال آبادی''' #منسوب به کمال آباد، با صفا، زیبا #لقب و کنیه پویانمای پارسی‌. [[رده:اصطلاحات ویژه ایرانی]] [[رده:اسم‌های فارسی]] ne1z5besimr06ol34avca8fsz5ll3l5 رده:Central Franconian اصطلاحات برگرفته از آلمانی علیای باستان 14 193476 848393 2022-08-19T00:50:59Z 83.122.234.212 اما م wikitext text/x-wiki –اما م dxbwnkvffzzstged0jfeotom4xkeyjb قره بلاغ(چشمه سیاه) 0 193477 848394 2022-08-19T01:52:28Z 213.205.242.25 صفحه‌ای تازه حاوی «روستایی زیبا در قزوین به زبان ترکی است.» ایجاد کرد wikitext text/x-wiki روستایی زیبا در قزوین به زبان ترکی است. puxtpyfhqfcr0gjr6s3ss8u56h12hkt بحث کاربر:AmirHossein Marjani 3 193478 848402 2022-08-19T07:10:21Z پیام به کاربر جدید 26498 افزودن [[الگو:خوشامدید|پیام خوش‌آمد]] به صفحهٔ بحث کاربر تازه wikitext text/x-wiki == خوش آمدید == [[ویکی‌واژه:تازه‌واردان، خوش آمدید|'''به ویکی‌واژه خوش‌آمدید''']]!<br /> امیدوارم حضوری طولانی مدت در ویکی‌واژه داشته باشید و بتوانیم با همکاری یکدیگر در جهت پیشرفت هر چه بیشتر این وبگاه گام برداریم. ویکی‌واژه منتظر نوشتارهای خوب شماست.<br /> این پیوندها می‌تواند سودمند باشد: {| |- |[[پرونده:Noia 64 apps help index.png|30px|right|link=ویکی‌واژه:راهنما|راهنما]] || [[ویکی‌واژه:راهنما|راهنما]] برای راهنمایی گرفتن |- | [[پرونده:Nuvola apps ksig.png|30px|right|link=ویکی‌واژه:آموزش سریع|آموزش سریع]] || [[ویکی‌واژه:آموزش سریع|آموزش سریع]] |- |||[[راهنما:افزودن سرواژه نو|افزودن سرواژهٔ نو]] راهنمای افزودن سرواژهٔ نو |- |||[[ویکی‌واژه:شیوه‌نامه|شیوه‌نامه]] شیوه‌نامهٔ ویکی‌واژه |- |[[File:Bucket in the sand.svg|right|50px]]||[[ویکی‌واژه:صفحه تمرین|صفحه تمرین]] برای تمرین ویرایش |- | [[پرونده:Nuvola apps chat.png|30px|right|link=ویکی‌واژه:قهوه‌خانه|قهوه‌خانه]]||[[ویکی‌واژه:قهوه‌خانه|قهوه‌خانه]] برای گفتگو دربارهٔ مسائل فنی و سیاست‌ها. |- |[[پرونده:Farsi.svg|30px|right|link=ویکی‌واژه:فارسی‌نویسی|فارسی‌نویسی]]||[[ویکی‌واژه:فارسی‌نویسی|فارسی‌نویسی]] |- |[[پرونده:Nuvola apps agent.svg|30px|right|link=w:ویکی‌پدیا:خودآموز|آموزش پیشرفته]]||[[w:ویکی‌پدیا:خودآموز|آموزش پیشرفته]] |- | |- | |- |'''پروژه‌های دیگر بنیاد'''||[[پرونده:Wikipedia-logo.png|25px|link=w:صفحه_اصلی|ویکی‌پدیا]][[پرونده:HSWikimedia.svg|30px|link=m:Special:Recentchanges|فراویکی]] [[پرونده:HSCommons.svg|30px|link=commons:Special:Recentchanges|ویکی‌انبار]][[پرونده:HSWNews.svg|30px|link=n:ویژه:تغییرات اخیر|ویکی‌خبر]] [[پرونده:HSWBooks.svg|30px|link=b:صفحه_اصلی|ویکی‌نَسک]] [[پرونده:HSWVoyage.svg|30px|link=voy:صفحه_اصلی|ویکی‌سفر]][[پرونده:HSWQuote.svg|30px|link=q:صفحه_اصلی|ویکی‌گفتاورد]][[پرونده:HSWSource.svg|30px|link=s:صفحه_اصلی|ویکی‌نبشته]] |} امیدوارم از ''[[ویکی‌واژه:ویکی‌واژه نویسان|ویکی‌واژه نویس]]'' بودن لذت ببرید! لطفاً در صفحات گفتگو نام خود را با چهار علامت مدک امضا کنید، (~&#126;~~)، با این کار نام شما و تاریخ به عنوان امضا درج خواهد شد. در صورتی که سوال داشتید، به صفحهٔ [[ویکی‌واژه:قهوه‌خانه|قهوه‌خانه]] بروید، یا اینکه از من در صفحهٔ بحثم بپرسید. باز هم خوش آمد می‌گویم!&nbsp;شاد باشید! -- [[کاربر:AFlorence|'''فلورانس''']] ([[بحث کاربر:AFlorence|بحث]]) ‏۱۹ اوت ۲۰۲۲، ساعت ۰۷:۱۰ (UTC) 4ue73urf8373rcduwt17fmw1cprw0jm بحث کاربر:HesselG 3 193479 848403 2022-08-19T08:55:17Z پیام به کاربر جدید 26498 افزودن [[الگو:خوشامدید|پیام خوش‌آمد]] به صفحهٔ بحث کاربر تازه wikitext text/x-wiki == خوش آمدید == [[ویکی‌واژه:تازه‌واردان، خوش آمدید|'''به ویکی‌واژه خوش‌آمدید''']]!<br /> امیدوارم حضوری طولانی مدت در ویکی‌واژه داشته باشید و بتوانیم با همکاری یکدیگر در جهت پیشرفت هر چه بیشتر این وبگاه گام برداریم. ویکی‌واژه منتظر نوشتارهای خوب شماست.<br /> این پیوندها می‌تواند سودمند باشد: {| |- |[[پرونده:Noia 64 apps help index.png|30px|right|link=ویکی‌واژه:راهنما|راهنما]] || [[ویکی‌واژه:راهنما|راهنما]] برای راهنمایی گرفتن |- | [[پرونده:Nuvola apps ksig.png|30px|right|link=ویکی‌واژه:آموزش سریع|آموزش سریع]] || [[ویکی‌واژه:آموزش سریع|آموزش سریع]] |- |||[[راهنما:افزودن سرواژه نو|افزودن سرواژهٔ نو]] راهنمای افزودن سرواژهٔ نو |- |||[[ویکی‌واژه:شیوه‌نامه|شیوه‌نامه]] شیوه‌نامهٔ ویکی‌واژه |- |[[File:Bucket in the sand.svg|right|50px]]||[[ویکی‌واژه:صفحه تمرین|صفحه تمرین]] برای تمرین ویرایش |- | [[پرونده:Nuvola apps chat.png|30px|right|link=ویکی‌واژه:قهوه‌خانه|قهوه‌خانه]]||[[ویکی‌واژه:قهوه‌خانه|قهوه‌خانه]] برای گفتگو دربارهٔ مسائل فنی و سیاست‌ها. |- |[[پرونده:Farsi.svg|30px|right|link=ویکی‌واژه:فارسی‌نویسی|فارسی‌نویسی]]||[[ویکی‌واژه:فارسی‌نویسی|فارسی‌نویسی]] |- |[[پرونده:Nuvola apps agent.svg|30px|right|link=w:ویکی‌پدیا:خودآموز|آموزش پیشرفته]]||[[w:ویکی‌پدیا:خودآموز|آموزش پیشرفته]] |- | |- | |- |'''پروژه‌های دیگر بنیاد'''||[[پرونده:Wikipedia-logo.png|25px|link=w:صفحه_اصلی|ویکی‌پدیا]][[پرونده:HSWikimedia.svg|30px|link=m:Special:Recentchanges|فراویکی]] [[پرونده:HSCommons.svg|30px|link=commons:Special:Recentchanges|ویکی‌انبار]][[پرونده:HSWNews.svg|30px|link=n:ویژه:تغییرات اخیر|ویکی‌خبر]] [[پرونده:HSWBooks.svg|30px|link=b:صفحه_اصلی|ویکی‌نَسک]] [[پرونده:HSWVoyage.svg|30px|link=voy:صفحه_اصلی|ویکی‌سفر]][[پرونده:HSWQuote.svg|30px|link=q:صفحه_اصلی|ویکی‌گفتاورد]][[پرونده:HSWSource.svg|30px|link=s:صفحه_اصلی|ویکی‌نبشته]] |} امیدوارم از ''[[ویکی‌واژه:ویکی‌واژه نویسان|ویکی‌واژه نویس]]'' بودن لذت ببرید! لطفاً در صفحات گفتگو نام خود را با چهار علامت مدک امضا کنید، (~&#126;~~)، با این کار نام شما و تاریخ به عنوان امضا درج خواهد شد. در صورتی که سوال داشتید، به صفحهٔ [[ویکی‌واژه:قهوه‌خانه|قهوه‌خانه]] بروید، یا اینکه از من در صفحهٔ بحثم بپرسید. باز هم خوش آمد می‌گویم!&nbsp;شاد باشید! -- [[کاربر:Mardetanha|'''مرد تنها''']] ([[بحث کاربر:Mardetanha|بحث]]) ‏۱۹ اوت ۲۰۲۲، ساعت ۰۸:۵۵ (UTC) 9ry5mcvazwowk14b9n5z8vwzo63njt5 بحث کاربر:Paeiz23 3 193480 848404 2022-08-19T10:07:11Z پیام به کاربر جدید 26498 افزودن [[الگو:خوشامدید|پیام خوش‌آمد]] به صفحهٔ بحث کاربر تازه wikitext text/x-wiki == خوش آمدید == [[ویکی‌واژه:تازه‌واردان، خوش آمدید|'''به ویکی‌واژه خوش‌آمدید''']]!<br /> امیدوارم حضوری طولانی مدت در ویکی‌واژه داشته باشید و بتوانیم با همکاری یکدیگر در جهت پیشرفت هر چه بیشتر این وبگاه گام برداریم. ویکی‌واژه منتظر نوشتارهای خوب شماست.<br /> این پیوندها می‌تواند سودمند باشد: {| |- |[[پرونده:Noia 64 apps help index.png|30px|right|link=ویکی‌واژه:راهنما|راهنما]] || [[ویکی‌واژه:راهنما|راهنما]] برای راهنمایی گرفتن |- | [[پرونده:Nuvola apps ksig.png|30px|right|link=ویکی‌واژه:آموزش سریع|آموزش سریع]] || [[ویکی‌واژه:آموزش سریع|آموزش سریع]] |- |||[[راهنما:افزودن سرواژه نو|افزودن سرواژهٔ نو]] راهنمای افزودن سرواژهٔ نو |- |||[[ویکی‌واژه:شیوه‌نامه|شیوه‌نامه]] شیوه‌نامهٔ ویکی‌واژه |- |[[File:Bucket in the sand.svg|right|50px]]||[[ویکی‌واژه:صفحه تمرین|صفحه تمرین]] برای تمرین ویرایش |- | [[پرونده:Nuvola apps chat.png|30px|right|link=ویکی‌واژه:قهوه‌خانه|قهوه‌خانه]]||[[ویکی‌واژه:قهوه‌خانه|قهوه‌خانه]] برای گفتگو دربارهٔ مسائل فنی و سیاست‌ها. |- |[[پرونده:Farsi.svg|30px|right|link=ویکی‌واژه:فارسی‌نویسی|فارسی‌نویسی]]||[[ویکی‌واژه:فارسی‌نویسی|فارسی‌نویسی]] |- |[[پرونده:Nuvola apps agent.svg|30px|right|link=w:ویکی‌پدیا:خودآموز|آموزش پیشرفته]]||[[w:ویکی‌پدیا:خودآموز|آموزش پیشرفته]] |- | |- | |- |'''پروژه‌های دیگر بنیاد'''||[[پرونده:Wikipedia-logo.png|25px|link=w:صفحه_اصلی|ویکی‌پدیا]][[پرونده:HSWikimedia.svg|30px|link=m:Special:Recentchanges|فراویکی]] [[پرونده:HSCommons.svg|30px|link=commons:Special:Recentchanges|ویکی‌انبار]][[پرونده:HSWNews.svg|30px|link=n:ویژه:تغییرات اخیر|ویکی‌خبر]] [[پرونده:HSWBooks.svg|30px|link=b:صفحه_اصلی|ویکی‌نَسک]] [[پرونده:HSWVoyage.svg|30px|link=voy:صفحه_اصلی|ویکی‌سفر]][[پرونده:HSWQuote.svg|30px|link=q:صفحه_اصلی|ویکی‌گفتاورد]][[پرونده:HSWSource.svg|30px|link=s:صفحه_اصلی|ویکی‌نبشته]] |} امیدوارم از ''[[ویکی‌واژه:ویکی‌واژه نویسان|ویکی‌واژه نویس]]'' بودن لذت ببرید! لطفاً در صفحات گفتگو نام خود را با چهار علامت مدک امضا کنید، (~&#126;~~)، با این کار نام شما و تاریخ به عنوان امضا درج خواهد شد. در صورتی که سوال داشتید، به صفحهٔ [[ویکی‌واژه:قهوه‌خانه|قهوه‌خانه]] بروید، یا اینکه از من در صفحهٔ بحثم بپرسید. باز هم خوش آمد می‌گویم!&nbsp;شاد باشید! -- [[کاربر:AFlorence|'''فلورانس''']] ([[بحث کاربر:AFlorence|بحث]]) ‏۱۹ اوت ۲۰۲۲، ساعت ۱۰:۰۷ (UTC) ni7iaqqxddmqx8yefitc6dp7kwknsdy stutter 0 193481 848405 2022-08-19T11:27:57Z 5.208.171.21 پرماکتگاچتخرماتقمبمغخاملکاچناکن wikitext text/x-wiki تپامرملخاهلتکاممککنگدکتن ook8k6gelxbq0ikjsx152o166ha3toa حفرهٔ واژنی 0 193482 848406 2022-08-19T11:28:59Z 50.114.67.50 حفره ی واژنی حفره ای در درون الت تناسلی زنانه گفته میشود که سایز استانداردی ندارد و هرکس با توجه به اصطحلاک ان اندازه گرفته میشود (¤) wikitext text/x-wiki حفره ی واژنی حفره ای در درون الت تناسلی زنانه گفته میشود که سایز استانداردی ندارد و هرکس با توجه به اصطحلاک ان اندازه گرفته میشود (¤) 32caprqesncez8e7rhvf8qoa4i2ud0u بحث کاربر:Hossein.1386.jamshidi 3 193483 848407 2022-08-19T11:55:36Z پیام به کاربر جدید 26498 افزودن [[الگو:خوشامدید|پیام خوش‌آمد]] به صفحهٔ بحث کاربر تازه wikitext text/x-wiki == خوش آمدید == [[ویکی‌واژه:تازه‌واردان، خوش آمدید|'''به ویکی‌واژه خوش‌آمدید''']]!<br /> امیدوارم حضوری طولانی مدت در ویکی‌واژه داشته باشید و بتوانیم با همکاری یکدیگر در جهت پیشرفت هر چه بیشتر این وبگاه گام برداریم. ویکی‌واژه منتظر نوشتارهای خوب شماست.<br /> این پیوندها می‌تواند سودمند باشد: {| |- |[[پرونده:Noia 64 apps help index.png|30px|right|link=ویکی‌واژه:راهنما|راهنما]] || [[ویکی‌واژه:راهنما|راهنما]] برای راهنمایی گرفتن |- | [[پرونده:Nuvola apps ksig.png|30px|right|link=ویکی‌واژه:آموزش سریع|آموزش سریع]] || [[ویکی‌واژه:آموزش سریع|آموزش سریع]] |- |||[[راهنما:افزودن سرواژه نو|افزودن سرواژهٔ نو]] راهنمای افزودن سرواژهٔ نو |- |||[[ویکی‌واژه:شیوه‌نامه|شیوه‌نامه]] شیوه‌نامهٔ ویکی‌واژه |- |[[File:Bucket in the sand.svg|right|50px]]||[[ویکی‌واژه:صفحه تمرین|صفحه تمرین]] برای تمرین ویرایش |- | [[پرونده:Nuvola apps chat.png|30px|right|link=ویکی‌واژه:قهوه‌خانه|قهوه‌خانه]]||[[ویکی‌واژه:قهوه‌خانه|قهوه‌خانه]] برای گفتگو دربارهٔ مسائل فنی و سیاست‌ها. |- |[[پرونده:Farsi.svg|30px|right|link=ویکی‌واژه:فارسی‌نویسی|فارسی‌نویسی]]||[[ویکی‌واژه:فارسی‌نویسی|فارسی‌نویسی]] |- |[[پرونده:Nuvola apps agent.svg|30px|right|link=w:ویکی‌پدیا:خودآموز|آموزش پیشرفته]]||[[w:ویکی‌پدیا:خودآموز|آموزش پیشرفته]] |- | |- | |- |'''پروژه‌های دیگر بنیاد'''||[[پرونده:Wikipedia-logo.png|25px|link=w:صفحه_اصلی|ویکی‌پدیا]][[پرونده:HSWikimedia.svg|30px|link=m:Special:Recentchanges|فراویکی]] [[پرونده:HSCommons.svg|30px|link=commons:Special:Recentchanges|ویکی‌انبار]][[پرونده:HSWNews.svg|30px|link=n:ویژه:تغییرات اخیر|ویکی‌خبر]] [[پرونده:HSWBooks.svg|30px|link=b:صفحه_اصلی|ویکی‌نَسک]] [[پرونده:HSWVoyage.svg|30px|link=voy:صفحه_اصلی|ویکی‌سفر]][[پرونده:HSWQuote.svg|30px|link=q:صفحه_اصلی|ویکی‌گفتاورد]][[پرونده:HSWSource.svg|30px|link=s:صفحه_اصلی|ویکی‌نبشته]] |} امیدوارم از ''[[ویکی‌واژه:ویکی‌واژه نویسان|ویکی‌واژه نویس]]'' بودن لذت ببرید! لطفاً در صفحات گفتگو نام خود را با چهار علامت مدک امضا کنید، (~&#126;~~)، با این کار نام شما و تاریخ به عنوان امضا درج خواهد شد. در صورتی که سوال داشتید، به صفحهٔ [[ویکی‌واژه:قهوه‌خانه|قهوه‌خانه]] بروید، یا اینکه از من در صفحهٔ بحثم بپرسید. باز هم خوش آمد می‌گویم!&nbsp;شاد باشید! -- [[کاربر:Mardetanha|'''مرد تنها''']] ([[بحث کاربر:Mardetanha|بحث]]) ‏۱۹ اوت ۲۰۲۲، ساعت ۱۱:۵۵ (UTC) ld5znqkbz7uxiazp3bnoijbj6g92cnk