Module:tyv-translit

Hello, you have come here looking for the meaning of the word Module:tyv-translit. In DICTIOUS you will not only get to know all the dictionary meanings for the word Module:tyv-translit, but we will also tell you about its etymology, its characteristics and you will know how to say Module:tyv-translit in singular and plural. Everything you need to know about the word Module:tyv-translit you have here. The definition of the word Module:tyv-translit will help you to be more precise and correct when speaking or writing your texts. Knowing the definition ofModule:tyv-translit, as well as those of other words, enriches your vocabulary and provides you with more and better linguistic resources.

This module will transliterate Tuvan language text per WT:TYV TR. 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:tyv-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", ="B", ="V", ="G", ="D", ="E", ="Yo", ="J", ="Z", ="İ", ="Y",
	="K", ="L", ="M", ="N", ="Ñ", ="O", ="Ö", ="P", ="R", ="S", ="T",
	="U", ="Ü", ="F", ="X", ="Ts", ="Ç", ="Ş", ="Şş", ="ʺ", ="I", ="ʹ",
	="E", ="Yu", ="Ya",
	='a', ='b', ='v', ='g', ='d', ='e', ='yo', ='j', ='z', ='i', ='y',
	='k', ='l', ='m', ='n', ='ñ', ='o', ='ö', ='p', ='r', ='s', ='t',
	='u', ='ü', ='f',
	='x', ='ts', ='ç', ='ş', ='şş', ='ʺ', ='ı', ='ʹ', ='e', ='yu', ='ya',
}

function export.tr(text, lang, sc)
	text = mw.ustring.gsub(text, 'Аъ', 'À')
    text = mw.ustring.gsub(text, 'аъ', 'à')
    text = mw.ustring.gsub(text, 'Эъ', 'È')
    text = mw.ustring.gsub(text, 'эъ', 'è')
    text = mw.ustring.gsub(text, 'Оъ', 'Ò')
    text = mw.ustring.gsub(text, 'оъ', 'ò')
    text = mw.ustring.gsub(text, 'Үъ', 'Ǜ')
    text = mw.ustring.gsub(text, 'үъ', 'ǜ')
    text = mw.ustring.gsub(text, 'Уъ', 'Ỳ')
    text = mw.ustring.gsub(text, 'уъ', 'ỳ')
    text = mw.ustring.gsub(text, 'Иъ', 'İ̀')
    text = mw.ustring.gsub(text, 'иъ', 'i̇̀')
    text = mw.ustring.gsub(text, 'Ыъ', 'Ì')
    text = mw.ustring.gsub(text, 'ыъ', 'ì')
    text = mw.ustring.gsub(text, 'Өъ', 'Ö̀')
    text = mw.ustring.gsub(text, 'өъ', 'ö̀')
	-- Ё needs converting if is decomposed
	text = text:gsub("ё","ё"):gsub("Ё","Ё")
	
	return (mw.ustring.gsub(text,'.',tab))
end
 
return export