Module:anui-pron: Difference between revisions

Jump to navigation Jump to search
No edit summary
No edit summary
Line 79: Line 79:
return term
return term
end
function format_IPA(items)
return "[[w:IPA chart|IPA]]<sup>([[IPA for ǂA Ṇṵĩ|key]])</sup>:&#32;" .. IPA_span(items)
end
function IPA_span(items)
local bits = {}
for _, item in ipairs(items) do
local bit = "<span style=\"font-size:110%;font-family:Gentium,'DejaVu Sans','Segoe UI',sans-serif>" .. item.pron .. "</span>"
table.insert(bits, bit)
end
return table.concat(bits)
end
function line_format(pronunciation)
local full_pronunciations = {}
local IPA_args = {{pron = '[' .. pronunciation .. ']'}}
table.insert(full_pronunciations, format_IPA(IPA_args))
return table.concat(full_pronunciations, ' or ')
end
function separate_word(term)
local result = {}
for word in gsplit(term, " ") do
table.insert(result, export.crux(word))
end
return table.concat(result, " ")
end
function export.show(frame)
local params = {
[1] = { default = mw.title.getCurrentTitle().nsText == 'Template' and "ǂA Ṇṵĩ" or mw.title.getCurrentTitle().text },
}
local args = require("Module:parameters").process(frame:getParent().args, params)
local term = args[1]
local ipa = "* "
ipa = ipa .. line_format(separate_word(term, false, true, false), {'Eastern'})
end
end


return export
return export