Zum Inhalt springen

Modul:kbd-translit

Vun Wiktionary

This module will transliterate Kabardian text per WT:KBD TR through the function tr.


--[[
Transliteration for the Adyghe.
]]
local M={}
 
local tt={
 
    ["а"]="ā", ["б"]="b", ["в"]="v", ["г"]="γ", ["д"]="d", ["е"]="e", ["ё"]="ë", ["ж"]="ž",
    ["з"]="z", ["и"]="i", ["й"]="j", ["к"]="k", ["л"]="l", ["м"]="m", ["н"]="n", ["о"]="o", 
    ["п"]="p", ["р"]="r", ["с"]="s", ["т"]="t", ["у"]="w", ["ф"]="f", ["х"]="x", ["ц"]="c", 
    ["ч"]="č", ["ш"]="š", ["щ"]="ŝ", ["ъ"]="”", ["ы"]="ə", ["ь"]="’", ["э"]="ă", ["ю"]="ju",
    ["я"]="jā", ["ӏ"]="ʾ", ["А"]="Ā", ["Б"]="B", ["В"]="V", ["Г"]="Γ", ["Д"]="D", ["Е"]="E", 
    ["Ё"]="Ë", ["Ж"]="Ž", ["З"]="Z", ["И"]="I", ["Й"]="J", ["К"]="K", ["Л"]="L", ["М"]="M", 
    ["Н"]="N", ["О"]="O", ["П"]="P", ["Р"]="R", ["С"]="S", ["Т"]="T", ["У"]="W", ["Ф"]="F", 
    ["Х"]="X", ["Ц"]="C", ["Ч"]="Č", ["Ш"]="Š", ["Щ"]="Ŝ", ["Ъ"]="”", ["Ы"]="Ə", ["Ь"]="’",
    ["Э"]="Ă", ["Ю"]="Ju", ["Я"]="Jā", ["Ӏ"]="ʾ"};
 
function M.tr(f)--translit any words or phrases
    if type(f) == 'table' then f = f.args[1] end
    f = mw.ustring.gsub(f, 'кхъу', 'q°')
    f = mw.ustring.gsub(f, 'Кхъу', 'Q°')
    f = mw.ustring.gsub(f, 'гъу', 'ġ°')
    f = mw.ustring.gsub(f, 'Кхъ', 'Q')
    f = mw.ustring.gsub(f, 'кхъ', 'q')
    f = mw.ustring.gsub(f, 'къу', 'q̇°')
    f = mw.ustring.gsub(f, 'кӏу', 'ḳ°')
    f = mw.ustring.gsub(f, 'хъу', 'χ°')
    f = mw.ustring.gsub(f, 'гу', 'g°')
    f = mw.ustring.gsub(f, 'гь', 'ɡ’')
    f = mw.ustring.gsub(f, 'гъ', 'ġ')
    f = mw.ustring.gsub(f, 'дж', 'ǯ̍')
    f = mw.ustring.gsub(f, 'дз', 'ʒ')
    f = mw.ustring.gsub(f, 'жъ', 'ẑ')
    f = mw.ustring.gsub(f, 'жь', 'ẑ')
    f = mw.ustring.gsub(f, 'ку', 'k°')
    f = mw.ustring.gsub(f, 'къ', 'q̇')
    f = mw.ustring.gsub(f, 'кӏ', 'č̣̍')
    f = mw.ustring.gsub(f, 'лъ', 'ł')
    f = mw.ustring.gsub(f, 'лӏ', 'ḷ')
    f = mw.ustring.gsub(f, 'пӏ', 'ṗ')
    f = mw.ustring.gsub(f, 'сӏ', 'ṣ̣')
    f = mw.ustring.gsub(f, 'тӏ', 'ṭ')
    f = mw.ustring.gsub(f, 'фӏ', 'f̣')
    f = mw.ustring.gsub(f, 'ху', 'x°')
    f = mw.ustring.gsub(f, 'хъ', 'χ')
    f = mw.ustring.gsub(f, 'хь', 'ḥ')
    f = mw.ustring.gsub(f, 'цӏ', 'c̣')
    f = mw.ustring.gsub(f, 'чу', 'č̍°')
    f = mw.ustring.gsub(f, 'щӏ', 'ṣ̂')
    f = mw.ustring.gsub(f, 'ӏу', 'ʾ°')
    f = mw.ustring.gsub(f, 'Гъу', 'Ġ°')
    f = mw.ustring.gsub(f, 'Къу', 'Q̇°')
    f = mw.ustring.gsub(f, 'Кӏу', 'Ḳ°')
    f = mw.ustring.gsub(f, 'Хъу', 'Χ°')
    f = mw.ustring.gsub(f, 'Гу', 'G°')
    f = mw.ustring.gsub(f, 'Гь', 'ɡ’')
    f = mw.ustring.gsub(f, 'Гъ', 'Ġ')
    f = mw.ustring.gsub(f, 'Дж', 'Ǯ̍')
    f = mw.ustring.gsub(f, 'Дз', 'Ʒ')
    f = mw.ustring.gsub(f, 'Жъ', 'Ẑ')
    f = mw.ustring.gsub(f, 'Жь', 'Ẑ̂')
    f = mw.ustring.gsub(f, 'Ку', 'K°')
    f = mw.ustring.gsub(f, 'Къ', 'Q̇')
    f = mw.ustring.gsub(f, 'Кӏ', 'Č̣̍')
    f = mw.ustring.gsub(f, 'Лъ', 'Ł')
    f = mw.ustring.gsub(f, 'Лӏ', 'Ḷ')
    f = mw.ustring.gsub(f, 'Пӏ', 'Ṗ')
    f = mw.ustring.gsub(f, 'Сӏ', 'Ṣ̣')
    f = mw.ustring.gsub(f, 'Тӏ', 'Ṭ')
    f = mw.ustring.gsub(f, 'Фӏ', 'F̣')
    f = mw.ustring.gsub(f, 'Ху', 'X°')
    f = mw.ustring.gsub(f, 'Хъ', 'Χ')
    f = mw.ustring.gsub(f, 'Хь', 'Ḥ')
    f = mw.ustring.gsub(f, 'Цӏ', 'C̣')
    f = mw.ustring.gsub(f, 'Чу', 'Č̍°')
    f = mw.ustring.gsub(f, 'Щӏ', 'Ṣ̂')
    f = mw.ustring.gsub(f, '.', tt)
    return f
end
return M