10,731
edits
TheNightAvl (talk | contribs) No edit summary |
TheNightAvl (talk | contribs) No edit summary |
||
Line 17: | Line 17: | ||
["E"] = "ɛ", | ["E"] = "ɛ", | ||
["O"] = "ɔ", | ["O"] = "ɔ", | ||
["%%"] = "ˌ", | |||
["%:"] = "ː", | ["%:"] = "ː", | ||
['%"'] = "ˈ", | ['%"'] = "ˈ", | ||
["% | ["%'"] = "ʲ", | ||
["%_j"] = "ʲ", | ["%_j"] = "ʲ", | ||
} | } | ||
for from, to in pairs(correspondences) do | for from, to in pairs(correspondences) do | ||
ipa = mw.ustring.gsub(ipa, "'''", " | ipa = mw.ustring.gsub(ipa, "'''", "ʹʹ") | ||
ipa = mw.ustring.gsub(ipa, "''", " | ipa = mw.ustring.gsub(ipa, "''", "ʹ") | ||
ipa = mw.ustring.gsub(ipa, from, to) | ipa = mw.ustring.gsub(ipa, from, to) | ||
ipa = mw.ustring.gsub(ipa, " | ipa = mw.ustring.gsub(ipa, "ʹʹ", "'''") | ||
ipa = mw.ustring.gsub(ipa, " | ipa = mw.ustring.gsub(ipa, "ʹ", "''") | ||
end | end | ||
return ipa | return ipa | ||
Line 45: | Line 45: | ||
if i > 1 then out = out .. ", " end | if i > 1 then out = out .. ", " end | ||
out = out .. '<span class="' .. class .. '">' | out = out .. '<span class="' .. class .. '">' | ||
local pieces = {} | if mw.ustring.match(i_ipa, "%*[^%*]+%*") then | ||
local pieces = {} | |||
for pre, escaped, post in mw.ustring.gmatch(i_ipa, "([^%*]*)(%*[^%*]+%*)([^%*]*)") do | |||
table.insert(pieces, get_SAMPAd(pre) .. '</span>' .. mw.ustring.match(escaped, "^%*([^%*]+)%*$") .. '<span class="' .. class .. '">' .. get_SAMPAd(post)) | |||
end | |||
i_ipa = table.concat(pieces) | |||
else | |||
i_ipa = get_SAMPAd(i_ipa) | |||
end | end | ||
if linked then | if linked then | ||
out = out .. "[[" .. language_pron .. "|" .. i_ipa .. "]]" | out = out .. "[[" .. language_pron .. "|" .. i_ipa .. "]]" |