This module will transliterate Yakut භාෂාව 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:sah-translit/testcases.

Functions

tr(text, lang, sc)
Transliterates a given piece of text written in the script specified by the code sc, and language specified by the code lang.
When the transliteration fails, returns nil.

local export = {}

local tab = {
	["А"]='A', ["а"]='a', ["Б"]='B', ["б"]='b', ["Г"]='G', ["г"]='g', ["Ҕ"]='Ğ', ["ҕ"]='ğ',
	["Д"]='D', ["д"]='d', ["И"]='İ', ["и"]='i', ["Й"]='Y', ["й"]='y', ["К"]='K', ["к"]='k',
	["Л"]='L', ["л"]='l', ["М"]='M', ["м"]='m', ["Н"]='N', ["н"]='n', ["Ҥ"]='Ñ', ["ҥ"]='ñ',
	["О"]='O', ["о"]='o', ["Ө"]='Ö', ["ө"]='ö', ["П"]='P', ["п"]='p', ["Р"]='R', ["р"]='r',
	["С"]='S', ["с"]='s', ["Һ"]='H', ["һ"]='h', ["Т"]='T', ["т"]='t', ["У"]='U', ["у"]='u',
	["Ү"]='Ü', ["ү"]='ü', ["Х"]='Q', ["х"]='q', ["Ч"]='C', ["ч"]='c', ["Ы"]='I', ["ы"]='ı', 
	["Э"]='E', ["э"]='e',
	-- non-native letters
	["В"]='V', ["в"]='v', ["Е"]='E', ["е"]='e', ["Ё"]='O', ["ё"]='o', ["Ж"]='Zh', ["ж"]='zh',
	["З"]='Z', ["з"]='z', ["Ф"]='F', ["ф"]='f', ["Ц"]='Ts', ["ц"]='ts', ["Ш"]='Sh', ["ш"]='sh', 
	["Щ"]='Shc', ["щ"]='shc', ['Ъ']='', ['ъ']='', ["Ь"]="", ["ь"]="", ["Ю"]='U', ["ю"]='u', 
	["Я"]='A', ["я"]='a',
}
 
function export.tr(text, lang, sc)
    text = mw.ustring.gsub(text, 'Дь', 'J')
    text = mw.ustring.gsub(text, 'дь', 'j')
    text = mw.ustring.gsub(text, 'НЬ', 'NY')
    text = mw.ustring.gsub(text, 'Нь', 'Ny')
    text = mw.ustring.gsub(text, 'нь', 'ny')
    
    -- soft vowels after a vowel or at the beginning of a word become j-
    text = mw.ustring.gsub(text, "([АОӨУҮЫЭЕЯЁЮИЕЪаоöуүыэяёюиеъ%A][\204\129\204\128]?)([еёюя])", "%1y%2")
    text = mw.ustring.gsub(text, "^([ЕЁЮЯ])", "Y%1")
    text = mw.ustring.gsub(text, "^([еёюя])", "y%1")
 
    return (mw.ustring.gsub(text,'.',tab))
end

return export
"https://si.wiktionary.org/w/index.php?title=Module:sah-translit&oldid=81932" වෙතින් සම්ප්‍රවේශනය කෙරිණි