Module:grk-mar-translit

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

This module will transliterate Mariupol Greek language text per WT:GRK-MAR 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:grk-mar-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 tri = {
 	="Č", ="Č", ="Dž",
 	="č", ="č", ="dž", 
}

local di = {
	="G", ="Ð", ="Θ",
	="g", ='ð', ='θ',
	="Mb", ="Ng", ="Nd", ="Š", ="Š", ="Ž",
	="C", ="C", ="Dz", 
	="mb", ="ng", ="nd", ="š", ="š", ="ž",
	="c", ="c", ="dz",

}

local tab = {
	="A", ="B", ="V", ="H", ="D",
	="Je", ="Ž", ="Z", ="I", ="J", ="K", ="L",
	="M", ="N", ="O", ="P", ="R", ="S",  
	="T", ="U", ="F", ="X", ="C", ="Č", ="Š", 
	="Ś", ="Y", ="E", ="Ju", ="Ja", ="ʹ",
	='a', ='b', ='v', ='h', ='d',
	='je', ='ž', ='z', ='i', ='j', ='k', ='l', 
	='m', ='n', ='o', ='p', ='r', ='s', 
	='t', ='u', ='f', ='x', ='c', ='č', ='š', 
	='y', ='e', ='ju', ='ja', ='ʹ', ='ś',
	
	
	="A", ="V", ="H", ="Ð", ="E", ="Z", ="Θ",
	="I", ="K", ="L", ="M", ="N", ="O", ="P",
	="R", ="S", ="T", ="U", ="F", ="X",
	="a", ="v", ="h", ="ð", ="e", ="z", ="θ",
	="i", ="k", ="l", ="m", ="n", ="o", ="p",
	="r", ="s", ="s", ="t", ="u", ="f", ="x",
	
	-- accents
	="Á", ="á", ="É", ="é", ="Í", ="í",
	="Ó", ="ó", ="Ú", ="ú"
}

function export.tr(text, lang, sc)

    text = mw.ustring.gsub(text, "Γι()", "J%1")
    text = mw.ustring.gsub(text, "γι()", "j%1")
   	text = mw.ustring.gsub(text, '...',tri)
   	text = mw.ustring.gsub('Q' .. text, '...',tri)
   	text = mw.ustring.gsub('Q' .. text, '...',tri)
   	text = mw.ustring.gsub('Q' .. text, '...',tri)
   	    text = mw.ustring.gsub(text, 'Q', '')
    text = mw.ustring.gsub(text, '..',di)
    text = mw.ustring.gsub('Q' .. text, '..',di)
    text = mw.ustring.gsub('Q' .. text, '..',di)
        text = mw.ustring.gsub(text, 'Q', '')
    text = mw.ustring.gsub(text, '.',tab)
	text = mw.ustring.gsub(text, "()j", "%1")
        
    return (text)
end

return export