Module:IPA: Difference between revisions

102 bytes added ,  23 December 2020
no edit summary
No edit summary
No edit summary
Line 22: Line 22:
else
else
if hasKey[lang:getCode()] then
if hasKey[lang:getCode()] then
IPA_key = "wikt:Appendix:" .. lang:getCanonicalName() .. " pronunciation"
IPA_key = "Appendix:" .. lang:getCanonicalName() .. " pronunciation"
else
else
IPA_key = "wikipedia:" .. lang:getCanonicalName() .. " phonology"
IPA_key = "wikipedia:" .. lang:getCanonicalName() .. " phonology"
Line 31: Line 31:


local prefix = "[[wikt:Wiktionary:International Phonetic Alphabet|IPA]]<sup>(" .. ( key_link or err_text ) .. ")</sup>:&#32;"
local prefix = "[[Wiktionary:International Phonetic Alphabet|IPA]]<sup>(" .. ( key_link or err_text ) .. ")</sup>:&#32;"
IPAs = export.format_IPA_multiple(lang, items, separator, no_count)
IPAs = export.format_IPA_multiple(lang, items, separator, no_count)
Line 128: Line 128:
if lang then
if lang then
-- Add syllable count if the language's diphthongs are listed in [[Module:syllables]].
-- Add syllable count if the language's diphthongs are listed in [[Module:syllables]].
-- Don't do this if the term has spaces or a liaison mark (‿).
if not no_count and mw.title.getCurrentTitle().namespace == 0 then
if not no_count and mw.title.getCurrentTitle().namespace == 0 then
m_syllables = m_syllables or require('Module:syllables')
m_syllables = m_syllables or require('Module:syllables')
if m_syllables.hasDiphthongs(lang) then
if m_data.langs_to_generate_syllable_count_categories[lang:getCode()] and
if determine_repr(item.pron) == "phonemic" or lang:getCode() == "ru" then
(determine_repr(item.pron) == "phonemic" or lang:getCode() == "ru") and
local syllable_count = m_syllables.getVowels(item.pron, lang)
not find(item.pron, "[ ‿]") then
if syllable_count then
local syllable_count = m_syllables.getVowels(item.pron, lang)
table.insert(categories, "[[Category:" .. lang:getCanonicalName() .. " " .. syllable_count .. "-syllable words]]")
if syllable_count then
end
table.insert(categories, "[[Category:" .. lang:getCanonicalName() .. " " .. syllable_count .. "-syllable words]]")
end
end
end
end
end
end


if lang:getCode() == "en" then
if lang:getCode() == "en" and hasInvalidSeparators(item.pron) then
if hasInvalidSeparators(item.pron) then
table.insert(categories, "[[Category:IPA for English using .ˈ or .ˌ]]")
table.insert(categories, "[[Category:IPA for English using .ˈ or .ˌ]]")
end
end
end
end
end