local U = mw.ustring.char
local acute = U(0x301) -- acute
local caron = U(0x30C) -- caron
local macron = U(0x304) -- macron
local ring_above = U(0x30A) -- ring above
local data = {
{
["a" .. macron] = "а̄", -- ā
["g" .. ring_above] = "г̊", -- g̊
["g" .. acute] = "ѓ", -- ǵ
["ɣ" .. ring_above] = "ғ̊", -- ɣ̊
["ɣ" .. caron] = "г̌", -- ɣ̌
["z" .. caron] = "ж", -- ž
["k" .. ring_above] = "к̊", -- k̊
["k" .. acute] = "ќ", -- ḱ
["q" .. ring_above] = "қ̊", -- q̊
["x" .. ring_above] = "х̊", -- x̊
["x" .. caron] = "х̌", -- x̌
["x" .. caron .. ring_above] = "х̌̊", -- x̌̊
["c" .. caron] = "ч", -- č
["j" .. caron] = "ҷ", -- ǰ
["s" .. caron] = "ш", -- š
["^e"] = "э",
},
{
["a"] = "а",
["ā"] = "а̄",
["b"] = "б",
["v"] = "в",
["w"] = "в̌",
["g"] = "г",
["ǵ"] = "ѓ",
["ɣ"] = "ғ",
["d"] = "д",
["δ"] = "д̌",
["e"] = "е",
["ə"] = "ә",
["ž"] = "ж",
["z"] = "з",
["i"] = "и",
["y"] = "й",
["k"] = "к",
["ḱ"] = "ќ",
["q"] = "қ",
["l"] = "л",
["m"] = "м",
["n"] = "н",
["o"] = "о",
["p"] = "п",
["r"] = "р",
["s"] = "с",
["t"] = "т",
["θ"] = "т̌",
["u"] = "у",
["f"] = "ф",
["x"] = "х",
["h"] = "ҳ",
["c"] = "ц",
["č"] = "ч",
["ǰ"] = "ҷ",
["š"] = "ш",
},
}
-- Add replacements for capitals: both an all-caps version ("JA")
-- and capitalized version ("Ja").
for _, replacements in ipairs(data) do
-- sortedPairs saves the list of table keys so that we can modify the table
-- while iterating over it.
for text, replacement in require "Module:table".sortedPairs(replacements) do
replacement = mw.ustring.upper(replacement)
replacements[mw.ustring.upper(text)] = replacement
replacements[mw.ustring.gsub(text, "^.", mw.ustring.upper)] = replacement
end
end
return data