Module:Olck-translit

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

This module will transliterate text in the Ol Chiki script. It is used to transliterate Santali. 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:Olck-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 conv = {
	='ô', ='t', ='g', ='ṅ', ='l',
	='a', ='k', ='j', ='m', ='v', 
	='i', ='s', ='h', ='ñ', ='r',
	='u', ='c', ='d', ='ṇ', ='y', 
	='e', ='p', ='ḍ', ='n', ='ṛ',
	='o', ='ṭ', ='b', ='w̃',
	='h', -- aspiration

	-- numerals
	='0', ='1', ='2', ='3', ='4', ='5', ='6', ='7', ='8', ='9',
	
	-- punctuation        
	='.',
	='.',
	
	-- special chars
	='̃', -- mu tudag: nasalization
	='ᱹ̃', -- mu gahla tudag: nasalization
	='ː' -- rela: gemination
}

local gahla_tudag = {
	='ŏ', ='ă', ='ĕ',
}

local ahad = {
	='g', ='j', ='d', ='b', ='h'
}

local pharka = {
	='k’', ='c’', ='t’', ='p’', ='h’'
}

local punctuation = '()'

function export.tr(text, lang, sc)
	text = mw.ustring.gsub(
		text,
		".",
		function(c)
			return conv
		end)
	
	-- word-final glottalization
	text = mw.ustring.gsub(text, '$', pharka)
	text = mw.ustring.gsub(
		text,
		'()' .. punctuation,
		function(c, d)
			return pharka .. d
		end)
		
	-- gahla tudag
	text = mw.ustring.gsub(
		text,
		'(.)ᱹ',
		function(c)
			return gahla_tudag
		end
	)
	
	-- ahad
	text = mw.ustring.gsub(
		text,
		'(.’)ᱽ',
		function(c)
			return ahad
		end
	)

	-- parkha
	text = mw.ustring.gsub(
		text,
		'(.)ᱼ',
		function(c)
			return pharka
		end
	)
	
	text = mw.ustring.gsub(text, 'h’', 'ʔ')

	return text
end
 
return export