Module:sia-translit

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

This module will transliterate Akkala Sami language 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:sia-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 U = mw.ustring.char
local rsubn = mw.ustring.gsub

local macron = U(0x0304)

local tt = {
	='A', ='a',
	="Ä", ="ä",
	="Å", ="å",
	='B', ='b',
	='V', ='v',
	='W', ='w',
	='G', ='g',
	='D', ='d',
	='Je', ='je',
	="Jo", ="jo",
	='Ž', ='ž',
	='Z', ='z',
	="H", ="h", ="h",
	='I', ='i',
	="Ī", ="ī",
	="J", ="j",
	="J̥", ="j̥", ="J̥", ="j̥",
	='K', ='k',
	='Ǩ', ='ǩ',
	='L', ='l',
	='M', ='m',
	='N', ='n',
	="N̥", ="n̥",
	="Ŋ", ="ŋ",
	='O', ='o',
	='P', ='p', 
	='R', ='r',
	='S', ='s',
	='T', ='t',
	='U', ='u', 
	="Ū", ="ū",
	='F', ='f',
	='X', ='x',
	='C', ='c',
	='Č', ='č',
	='Š', ='š',
	="Šč", ="šč",
	="Y", ="y",
	="Ï", ="ï",
	="", ="",
	="’", ="’", = "’", ="’",
	="E", ="e",
	="’E", ="’e",
	="Ju", ="ju",
	="Ja", ="ja",
}

local vowel = "аӓеёиӣоуӯыӹэӭюяАӒЕЁИӢОУӮЫӸЭӬЮЯ"

function export.tr(text, lang, sc)
	text = rsubn(text, "^" .. "я" .. macron, "jā")
	text = rsubn(text, "^" .. "е" .. macron, "jē")
	text = rsubn(text, "^" .. "Я" .. macron, "Jā")
	text = rsubn(text, "^" .. "Е" .. macron, "Jē")

	text = rsubn(text, " " .. "я" .. macron, " jā")
	text = rsubn(text, " " .. "e" .. macron, " jē")
	text = rsubn(text, " " .. "Я" .. macron, " jā")
	text = rsubn(text, " " .. "E" .. macron, " jē")

	text = rsubn(text, "()е", "%1ьэ")
	text = rsubn(text, "()ё", "%1ьо")
	text = rsubn(text, "()ю", "%1ьу")
	text = rsubn(text, "()я", "%1ьа")
	
	text = rsubn(text, "()Е", "%1ЬЭ")
	text = rsubn(text, "()Ё", "%1ЬО")
	text = rsubn(text, "()Ю", "%1ЬУ")
	text = rsubn(text, "()Я", "%1ЬА")
	
	text = rsubn(text, "()ь", "%1й")
	text = rsubn(text, "НЬ", "НЙ")
	
	text = rsubn(text, "()ҍ", "%1й")
	text = rsubn(text, "Лҍ", "ЛЙ")

	text = rsubn(text, '.', tt)
	
	return text
end

return export