Module:IPA: Difference between revisions

Jump to navigation Jump to search
1,123 bytes removed ,  18 November 2025
no edit summary
No edit summary
No edit summary
 
Line 125: Line 125:


local IPAs, categories = export.format_IPA_multiple(lang, items, separator, no_count, "raw")
local IPAs, categories = export.format_IPA_multiple(lang, items, separator, no_count, "raw")
if is_content_page then
insert(categories, {
cat = langname .. " terms with IPA pronunciation",
sort_key = sort_key
})
end


local prontext = prefix .. IPAs
local prontext = prefix .. IPAs
Line 278: Line 271:
if namespace == 10 then -- Template
if namespace == 10 then -- Template
insert(items, {pron = "/aɪ piː ˈeɪ/"})
insert(items, {pron = "/aɪ piː ˈeɪ/"})
else
insert(categories, "Pronunciation templates without a pronunciation")
end
end
end
end
Line 412: Line 403:
-- Strip any reconstruction asterisk and representation marks.
-- Strip any reconstruction asterisk and representation marks.
pron = sub(pron, #opening + 1 + (reconstructed and 1 or 0), -#closing - 1)
pron = sub(pron, #opening + 1 + (reconstructed and 1 or 0), -#closing - 1)
 
if not repr then
insert(categories, "IPA pronunciations with invalid representation marks")
-- insert(err, "invalid representation marks")
-- Removed because it's annoying when previewing pronunciation pages.
end
if repr ~= "orthographic" and lang and lang:getCode() == "en" and hasInvalidSeparators(pron) then
if repr ~= "orthographic" and lang and lang:getCode() == "en" and hasInvalidSeparators(pron) then
insert(categories, "English IPA pronunciations with invalid separators")
insert(categories, "English IPA pronunciations with invalid separators")
end
if pron == "" then
insert(categories, "IPA pronunciations with no pronunciation present")
end
end


Line 434: Line 416:
end
end
insert(result, nonstandard)
insert(result, nonstandard)
insert(categories,
{cat = "IPA pronunciations with obsolete or nonstandard characters", sort_key = nonstandard}
)
end
end


Line 510: Line 489:
result = ugsub(result, pattern, " ")
result = ugsub(result, pattern, " ")
end
end
if not match(result, "^ *$") then
local category = "IPA pronunciations with invalid IPA characters"
if not is_content_page then
category = category .. "/non_mainspace"
end
insert(categories, category)
insert(err, "invalid IPA characters (" .. result .. ")")
end
end
if found_HTML then
insert(categories, "IPA pronunciations with paired HTML tags")
end
end


Line 553: Line 520:
insert(phonemes, "<span style=\"color: var(--wikt-palette-red,red)\">" .. phoneme .. "</span>")
insert(phonemes, "<span style=\"color: var(--wikt-palette-red,red)\">" .. phoneme .. "</span>")
rest = usub(rest, 2)
rest = usub(rest, 2)
insert(categories, "IPA pronunciations with invalid phonemes/" .. lang:getCode())
end
end
end
end

Navigation menu