Module:uum-translit

Hello, you have come here looking for the meaning of the word Module:uum-translit. In DICTIOUS you will not only get to know all the dictionary meanings for the word Module:uum-translit, but we will also tell you about its etymology, its characteristics and you will know how to say Module:uum-translit in singular and plural. Everything you need to know about the word Module:uum-translit you have here. The definition of the word Module:uum-translit will help you to be more precise and correct when speaking or writing your texts. Knowing the definition ofModule:uum-translit, as well as those of other words, enriches your vocabulary and provides you with more and better linguistic resources.
A user suggests that this Urum module page be cleaned up.
Please see the discussion on Requests for cleanup(+) for more information and remove this template after the problem has been dealt with.

This module will transliterate Urum language text per WT:UUM 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:uum-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",    ="Ž",                                        ="Z",    ="I",    ="J",
	
     ="K",  ="L", ="M", ="N",  ="O",  ="Ö", ="P", ="R", ="S",  ="T",
="U",  ="Ü", ="F", ="H", ="Č", ="Š",   ="Ǧ", ="Y", ="E",
='a', ='b', ='v', ='g',  ='d', ='e',  ='ž',  ='z', ='i', ='j',
='k', ='l', ='m', ='n',  ='o', ='ö',  ='p',  ='r', ='s', ='t',
='u', ='ü', ='f', ='h',  ='č',  ='š', ='ǧ', ='y', ='e',
= 'dž' , = 'Dž',
}                  

local iotated = {
	 = "Je",
	 = "je",
}

function export.tr(text, lang, sc)
	local ugsub = mw.ustring.gsub
	
	-- е after a vowel or at the beginning of a word becomes je	
	text = ugsub(text, "(?)е", "%1je")
	--text = mw.ustring.gsub(text, "(?)е", "%1je")
	text = ugsub(text, "^", iotated)
	text = ugsub(text, "()()", function(a, b)
			return a .. iotated
		end)
	
	return (ugsub(text, '.', tab))
end
 
return export