Module:Rohg-translit

Hello, you have come here looking for the meaning of the word Module:Rohg-translit. In DICTIOUS you will not only get to know all the dictionary meanings for the word Module:Rohg-translit, but we will also tell you about its etymology, its characteristics and you will know how to say Module:Rohg-translit in singular and plural. Everything you need to know about the word Module:Rohg-translit you have here. The definition of the word Module:Rohg-translit will help you to be more precise and correct when speaking or writing your texts. Knowing the definition ofModule:Rohg-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 Hanifi Rohingya script. It is used to transliterate Rohingya. 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:Rohg-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 = require("Module:string/char")
 
local tt = {
	-- consonants
	="", ="b", ="t", ="th",
	="j", ="ch", ="h", ="kh",
	="f", ="p", ="d", ="dh",
	="r", ="ç", ="z", ="s",
	="c", ="k", ="g", ="l",
	="m", ="n", ="w", ="u",
	="y", ="i", ="ng", ="ny", ="v",
	
	-- vowels
	="a", ="i", ="u", ="e", ="o",

	-- others
	="", --only used after some ending consonants
	="ñ", --nasalization
	="", --ZWJ, might appear to adjust consonants

	-- numerals
	="0", ="1", ="2", ="3", ="4",
	="5", ="6", ="7", ="8", ="9",
}

function export.tr(text, lang, sc)

	text = mw.ustring.gsub(text, ".", tt)

	-- tones and special mark
	text = mw.ustring.gsub(text, "(.)𐴤", "%1́")
	text = mw.ustring.gsub(text, "(.)𐴥", "%1́%1")
	text = mw.ustring.gsub(text, "(.)𐴦", "%1%1́")
	text = mw.ustring.gsub(text, "(.)𐴧", "%1%1")

	return text

end

return export