Module:headword: Difference between revisions

Jump to navigation Jump to search
2,210 bytes removed ,  6 August 2024
no edit summary
No edit summary
No edit summary
Line 518: Line 518:
-- sorted based on the default MediaWiki sortkey, so we check against
-- sorted based on the default MediaWiki sortkey, so we check against
-- that.
-- that.
if tbl == true then
if page.raw_defaultsort ~= sortkey then
insert(lang_cats, lang:getFullName() .. " terms with non-redundant non-automated sortkeys")
end
return
end
local redundant, different
local redundant, different
for k in pairs(tbl) do
for k in pairs(tbl) do
Line 531: Line 525:
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 732: Line 720:
local auto_sc = data.lang:findBestScript(head.term)
local auto_sc = data.lang:findBestScript(head.term)
if (
 
auto_sc:getCode() == "None" and
require(scripts_module).findBestScriptWithoutLang(head.term):getCode() ~= "None"
) then
insert(data.categories, full_langname .. " terms in nonstandard scripts")
end
if not (head.sc or data.sc) then -- No script code given, so use autodetected script.
if not (head.sc or data.sc) then -- No script code given, so use autodetected script.
head.sc = auto_sc
head.sc = auto_sc
Line 743: Line 726:
if not head.sc then -- Overall script code given.
if not head.sc then -- Overall script code given.
head.sc = data.sc
head.sc = data.sc
end
-- Track uses of sc parameter.
if head.sc:getCode() == auto_sc:getCode() then
insert(data.categories, full_langname .. " terms with redundant script codes")
else
insert(data.categories, full_langname .. " terms with non-redundant manual script codes")
end
end
end
end
Line 784: Line 761:
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 manual_tr then
if (remove_links(manual_tr) == remove_links(automated_tr)) and (not head.tr_fail) then
insert(data.categories, full_langname .. " terms with redundant transliterations")
elseif not head.tr_fail then
insert(data.categories, full_langname .. " terms with non-redundant manual transliterations")
end
end


if not manual_tr then
if not manual_tr then
Line 875: Line 844:


------------ 8. Insert additional categories. ------------
------------ 8. Insert additional categories. ------------
if has_redundant_head_param then
if not data.no_redundant_head_cat then
insert(data.categories, full_langname .. " terms with redundant head parameter")
end
end


-- If the first head is multiword (after removing links), maybe insert into "LANG multiword terms".
-- If the first head is multiword (after removing links), maybe insert into "LANG multiword terms".
Line 1,050: Line 1,013:
char = upper
char = upper
end
end
insert(data.categories, full_langname .. " terms spelled with " .. char)
end
end
end
end
Line 1,057: Line 1,019:
-- If a diacritic doesn't appear in any of the standard characters, also categorise for it generally.
-- If a diacritic doesn't appear in any of the standard characters, also categorise for it generally.
sc_standard = toNFD(sc_standard)
sc_standard = toNFD(sc_standard)
for diacritic in rgmatch(page.decompose_pagename, page.comb_chars.diacritics_single) do
if not rmatch(sc_standard, diacritic) then
insert(data.categories, full_langname .. " terms spelled with ◌" .. diacritic)
end
end
for diacritic in rgmatch(page.decompose_pagename, page.comb_chars.diacritics_double) do
if not rmatch(sc_standard, diacritic) then
insert(data.categories, full_langname .. " terms spelled with ◌" .. diacritic .. "◌")
end
end
end
end
end
end
Line 1,076: Line 1,028:
character = upper
character = upper
end
end
insert(data.categories, full_langname .. " terms spelled with " .. character)
end
end
end
end
Line 1,085: Line 1,036:
while rmatch(pagename, "(%a)" .. ("%1"):rep(i)) do
while rmatch(pagename, "(%a)" .. ("%1"):rep(i)) do
i = i + 1
i = i + 1
insert(data.categories, full_langname .. " terms with " .. i .. " consecutive instances of the same letter")
end
end
end
end

Navigation menu