Module:yux-translit

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

This module will transliterate Southern Yukaghir 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:yux-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 u = mw.ustring.char

local MACRON    = u(0x0304)
local DOTABOVE  = u(0x0307)
local DOTBELOW  = u(0x0323)

local str_gsub, ugsub = string.gsub, mw.ustring.gsub
local UTF8char = '*'

local export = {}

local tab = {
	='A', ='a', ='B', ='b', ='W', ='w', 
	='G', ='g', ='H', ='h',	='D', ='d', 
	='Ž', ='ž', ='I', ='i', ='J', ='j',
	='K', ='k', ='L', ='l', ='M', ='m',
	='N', ='n', ='Ŋ', ='ŋ',	='O', ='o',
	='Ø', ='ø', ='P', ='p', ='R', ='r', 
	='T', ='t', ='U', ='u', ='F', ='f', 
	='Q', ='q', ='Č', ='č',	='Š', ='š', 
	='E', ='e',
	
	-- non-native letters
	 ='Je', ='je', 
	 ='Jo', ='jo',
	 ='Z', ='z', 
	 ='C', ='c',  
	 ='Ś', ='ś', 
	 ='Y', ='y',
	 ='Ju', ='ju',
	 ='Ja', ='ja',
	 ="ʺ", ="ʺ", 
	 ='ʹ', ='ʹ',
	 ='S', ='s'
}

local other = {
	{ 'Аа', 'Ā' },
	{ 'аа', 'ā' },
	{ 'Ээ', 'Ē' },
	{ 'ээ', 'ē' },
	{ 'Ии', 'Ī' },
	{ 'ии', 'ī' },
	{ 'Оо', 'Ō' },
	{ 'оо', 'ō' },
	{ 'Уу', 'Ū' },
	{ 'уу', 'ū' },
	{ 'Өө', 'Ø̄'},
	{ 'өө', 'ø̄'},
	{ 'Оу', 'Ow'},
	{ 'оу', 'ow'},
}
 
function export.tr(text, lang, sc)
	for i, replacement in ipairs(other) do
		text = str_gsub(text, unpack(replacement))
	end
 
    return (str_gsub(text, UTF8char, tab))
end

return export