Module:headword: Difference between revisions

No edit summary
No edit summary
 
(11 intermediate revisions by the same user not shown)
Line 436: Line 436:
if not saw_translit_page and data.lang:hasType("etymology-only") then
if not saw_translit_page and data.lang:hasType("etymology-only") then
langname = data.lang:getFullName()
langname = data.lang:getFullName()
transliteration_page = new_title(langname .. " transliteration", "Wiktionary")
transliteration_page = new_title(langname .. " transliteration")


if transliteration_page and transliteration_page:getContent() then
if transliteration_page and transliteration_page:getContent() then
translits_formatted = " [[Wiktionary:" .. langname .. " transliteration|•]]" .. translits_formatted
translits_formatted = " [[" .. langname .. " transliteration|•]]" .. translits_formatted
end
end
end
end
Line 789: Line 789:
-- that.
-- that.
if tbl == true then
if tbl == true then
if page.raw_defaultsort ~= sortkey then
insert(lang_cats, lang:getFullName() .. " terms with non-redundant non-automated sortkeys")
end
return
return
end
end
Line 801: Line 798:
different = true
different = true
end
end
end
if redundant then
insert(lang_cats, lang:getFullName() .. " terms with redundant sortkeys")
end
if different then
insert(lang_cats, lang:getFullName() .. " terms with non-redundant non-automated sortkeys")
end
end
return sortkey
return sortkey
Line 816: Line 807:
local canonical = lang:getCanonicalName()
local canonical = lang:getCanonicalName()
local tbl, sortkey = page.wikitext_topic_cat[lang:getCode()]
local tbl, sortkey = page.wikitext_topic_cat[lang:getCode()]
if tbl then
sortkey = handle_raw_sortkeys(tbl, sortkey, page, lang, lang_cats)
insert(lang_cats, canonical .. " entries with topic categories using raw markup")
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)
insert(lang_cats, canonical .. " entries with language name categories using raw markup")
insert(lang_cats, canonical .. " entries with language name categories using raw markup")
end
if get_current_L2() ~= canonical then
insert(lang_cats, canonical .. " entries with incorrect language header")
-- [[Special:WhatLinksHere/Wiktionary:Tracking/headword/incorrect language header]]
-- [[Special:WhatLinksHere/Wiktionary:Tracking/headword/incorrect language header/LANGCODE]]
track("incorrect language header", lang)
end
end
end
end
Line 965: Line 946:
-- add an appropriate category.
-- add an appropriate category.
local postype = export.pos_lemma_or_nonlemma(data.pos_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.
    if not postype then
-- [[Special:WhatLinksHere/Wiktionary:Tracking/headword/unrecognized pos]]
    elseif not data.noposcat then
-- [[Special:WhatLinksHere/Wiktionary:Tracking/headword/unrecognized pos/LANGCODE]]
    local main_cat = data.lang:getMainCategoryName()
track("unrecognized pos", data.lang)
   
-- [[Special:WhatLinksHere/Wiktionary:Tracking/headword/unrecognized pos/POS]]
        if postype:match("^lemma") and main_cat ~= "lemma" then
-- [[Special:WhatLinksHere/Wiktionary:Tracking/headword/unrecognized pos/POS/LANGCODE]]
            postype = main_cat
track("unrecognized pos/pos/" .. data.pos_category, data.lang)
        end
elseif not data.noposcat then
        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]]
Line 1,011: Line 993:
end
end


if is_reconstructed then
if is_reconstructed and not data.lang:hasType("conlang") then
default_head = "*" .. default_head
default_head = "*" .. default_head
end
end
Line 1,508: Line 1,490:
-- 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)
if data.affix then
for _, aff in ipairs(data.affix) do
if mw.ustring.match(aff, "^%-[^-]*%-$") then
table.insert(data.categories, data.lang:getCanonicalName() .. " terms interfixed with " .. aff)
elseif mw.ustring.match(aff, "%-%s%-") then
table.insert(data.categories, data.lang:getCanonicalName() .. " terms circumfixed with " .. aff)
elseif mw.ustring.match(aff, "%-$") then
table.insert(data.categories, data.lang:getCanonicalName() .. " terms prefixed with " .. aff)
elseif mw.ustring.match(aff, "^%-") then
table.insert(data.categories, data.lang:getCanonicalName() .. " terms suffixed with " .. aff)
end
end
end


------------ 10. Format and return headwords, genders, inflections and categories. ------------
------------ 10. Format and return headwords, genders, inflections and categories. ------------