Module:ba-translit
Appearance
- පහත දැක්වෙන උපදෙස්, Module:documentation/functions/translit මගින් ජනනය කොට ඇත. [සංස්කරණය කරන්න]
- ප්රයෝජනවත් සබැඳි: උප පිටු ලැයිස්තුව • සබැඳි • transclusions • testcases • sandbox
This module will transliterate Bashkir භාෂාව text.
The module should preferably not be called directly from templates or other modules.
To use it from a template, use {{xlit}}
.
Within a module, use Module:languages#Language:transliterate.
For testcases, see Module:ba-translit/testcases.
Functions
[සංස්කරණය]tr(text, lang, sc)
- Transliterates a given piece of
text
written in the script specified by the codesc
, and language specified by the codelang
. - When the transliteration fails, returns
nil
.
local export = {}
local tt = {
["ү"]="ü", ['Ү']='Ü', ["т"]="t", ['Т']='T', ["р"]="r", ['Р']='R', ["ф"]="f", ['Ф']='F', ["ө"]="ö", ['Ө']='Ö',
["ю"]="yu", ['Ю']='Yu', ["ш"]="ş", ['Ш']='Ş', ["ь"]="’", ['Ь']='’', ["ъ"]="ʺ", ['Ъ']='ʺ', ["н"]="n", ['Н']='N',
["п"]="p", ['П']='P', ["й"]="y", ['Й']='Y', ["л"]="l", ['Л']='L', ["з"]="z", ['З']='Z', ["е"]="e", ['Е']='E',
["г"]="g", ['Г']='G', ["б"]="b", ['Б']='B', ["у"]="u", ['У']='U', ["с"]="s", ['С']='S', ["х"]="x", ['Х']='X',
["ч"]="ç", ['Ч']='Ç', ["щ"]="şç", ['Щ']='Şç', ["я"]="ya", ['Я']='Ya', ["ы"]="ı", ['Ы']='I', ["э"]="e", ['Э']='E',
["м"]="m", ['М']='M', ["о"]="o", ['О']='O', ["и"]="i", ['И']='İ', ["ё"]="yo", ['Ё']='Yo', ["ж"]="j", ['Ж']='j',
["к"]="k", ['К']='K', ["д"]="d", ['Д']='D', ["в"]="v", ['В']='V', ["ц"]="ts", ['Ц']='Ts', ["а"]="a", ['А']='A',
["ң"]="ŋ", ['Ң']='Ŋ', ["ғ"]="ğ", ['Ғ']='Ğ', ["ҙ"]="ð", ['Ҙ']='Đ', ["ҡ"]="q", ['Ҡ']='Q', ["ҫ"]="θ", ['Ҫ']='Θ',
["һ"]="h", ['Һ']='H', ["ә"]="ä", ['Ә']='Ä'
};
local iotated = {
['е'] = 'ye',
['Е'] = 'Ye',
}
function export.tr(text, lang, sc)
local str_gsub = string.gsub
local ugsub = mw.ustring.gsub
-- ү/у should be transliterated as w after vowels
text = ugsub(text, "([АаЕеЭэЮюЯяӘәИиҮүУуӨөЫы])[үу]", "%1w")
text = ugsub(text,
"([АОӨӘУЫЕЯЁЮИЕаоөәуыэяёюиеъь%A][́̀]?)([Ее])",
function(a, e)
return a .. iotated[e]
end)
text = ugsub(text,
"^[Ее]",
iotated)
text = str_gsub(text, '[\1-\127\194-\244][\128-\191]*', tt)
return text
end
return export