Module:headword: Difference between revisions
No edit summary |
No edit summary |
||
| (4 intermediate revisions by the same user not shown) | |||
| Line 693: | Line 693: | ||
-- that. | -- that. | ||
if tbl == true then | if tbl == true then | ||
return | return | ||
end | end | ||
| Line 705: | Line 702: | ||
different = true | different = true | ||
end | end | ||
end | end | ||
return sortkey | return sortkey | ||
| Line 722: | Line 713: | ||
if tbl then | if tbl then | ||
sortkey = handle_raw_sortkeys(tbl, sortkey, page, lang, lang_cats) | sortkey = handle_raw_sortkeys(tbl, sortkey, page, lang, lang_cats) | ||
end | end | ||
tbl = page.wikitext_langname_cat[canonical] | tbl = page.wikitext_langname_cat[canonical] | ||
if tbl then | if tbl then | ||
handle_raw_sortkeys(tbl, sortkey, page, lang, lang_cats) | handle_raw_sortkeys(tbl, sortkey, page, lang, lang_cats) | ||
end | end | ||
end | end | ||
| Line 859: | Line 845: | ||
local postype = export.pos_lemma_or_nonlemma(data.pos_category) | local postype = export.pos_lemma_or_nonlemma(data.pos_category) | ||
if not data.noposcat then | if not data.noposcat then | ||
if postype == "lemma" then | |||
postype = data.lang:getMainCategoryName() | |||
end | |||
insert(data.categories, 1, full_langname .. " " .. postype .. "s") | insert(data.categories, 1, full_langname .. " " .. postype .. "s") | ||
end | end | ||
insert(data.categories, 1, "Contionary") | |||
-- EXPERIMENTAL: see [[Wiktionary:Beer parlour/2024/June#Decluttering the altform mess]] | -- EXPERIMENTAL: see [[Wiktionary:Beer parlour/2024/June#Decluttering the altform mess]] | ||
if data.altform then | if data.altform then | ||
| Line 998: | Line 990: | ||
if automated_tr or head.tr_fail then | if automated_tr or head.tr_fail then | ||
local manual_tr = head.tr | local manual_tr = head.tr | ||
if not manual_tr then | if not manual_tr then | ||
| Line 1,095: | Line 1,079: | ||
------------ 9. Insert additional categories. ------------ | ------------ 9. Insert additional categories. ------------ | ||
-- If the first head is multiword (after removing links), maybe insert into "LANG multiword terms". | |||
if not data.nomultiwordcat and any_script_has_spaces and postype == "lemma" then | if not data.nomultiwordcat and any_script_has_spaces and postype == "lemma" then | ||
local no_multiword_cat = m_headword_data.no_multiword_cat | local no_multiword_cat = m_headword_data.no_multiword_cat | ||
| Line 1,326: | Line 1,304: | ||
end | end | ||
if data.affix then | |||
for _, aff in ipairs(data.affix) do | |||
if mw.ustring.match(aff, "^%-[^-]*%-$") then | |||
table.insert(data.categories, data.lang:getCanonicalName() .. " words interfixed with " .. aff) | |||
elseif mw.ustring.match(aff, "%-%s%-") then | |||
table.insert(data.categories, data.lang:getCanonicalName() .. " words circumfixed with " .. aff) | |||
elseif mw.ustring.match(aff, "%-$") then | |||
table.insert(data.categories, data.lang:getCanonicalName() .. " words prefixed with " .. aff) | |||
elseif mw.ustring.match(aff, "^%-") then | |||
table.insert(data.categories, data.lang:getCanonicalName() .. " words suffixed with " .. aff) | |||
end | |||
end | |||
end | |||
-- Add to various maintenance categories. | -- Add to various maintenance categories. | ||
export.maintenance_cats(page, data.lang, data.categories, data.whole_page_categories) | export.maintenance_cats(page, data.lang, data.categories, data.whole_page_categories) | ||