Module:User:Mofvanes/translit

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


local export = {}

local lang = require("Module:languages").getByCode("oj")
local m_string_utilities = require("Module:string utilities")
local m_links = require("Module:links")

local rfind = mw.ustring.find
local rsubn = mw.ustring.gsub
local ulower = mw.ustring.lower
local usub = mw.ustring.sub

local function rsub(term, foo, bar)
	local retval = rsubn(term, foo, bar)
	return retval
end

local function get_index(str, list)
	if list == nil then return -1 end
	for i = 1, #list do
		if str == list then return i end
	end return -1
end

local function char_at(str, pos) return usub(str, pos, pos) end
local function in_set(str, list) if get_index(str, list) ~= -1 then return true else return false end end

local syllables = {
	 = "ᐁ",  = "ᐃ",  = "ᐅ",  = "ᐊ",  = "ᐄ",  = "ᐆ",  = "ᐋ",
	 = "ᐯ",  = "ᐱ",  = "ᐳ",  = "ᐸ",  = "ᐲ",  = "ᐴ",  = "ᐹ",
	 = "ᑌ",  = "ᑎ",  = "ᑐ",  = "ᑕ",  = "ᑏ",  = "ᑑ",  = "ᑖ",
	 = "ᑫ",  = "ᑭ",  = "ᑯ",  = "ᑲ",  = "ᑮ",  = "ᑰ",  = "ᑳ",
	 = "ᒉ",  = "ᒋ",  = "ᒍ",  = "ᒐ",  = "ᒌ",  = "ᒎ",  = "ᒑ",
	 = "ᒣ",  = "ᒥ",  = "ᒧ",  = "ᒪ",  = "ᒦ",  = "ᒨ",  = "ᒫ",
	 = "ᓀ",  = "ᓂ",  = "ᓄ",  = "ᓇ",  = "ᓃ",  = "ᓅ",  = "ᓈ",
	 = "ᓭ",  = "ᓯ",  = "ᓱ",  = "ᓴ",  = "ᓰ",  = "ᓲ",  = "ᓵ",
	 = "ᔐ",  = "ᔑ",  = "ᔓ",  = "ᔕ",  = "ᔒ",  = "ᔔ",  = "ᔖ",
	 = "ᔦ",  = "ᔨ",  = "ᔪ",  = "ᔭ",  = "ᔩ",  = "ᔫ",  = "ᔮ",
	 = "ᐦᐯ",  = "ᐦᐱ",  = "ᐦᐳ",  = "ᐦᐸ",  = "ᐦᐲ",  = "ᐦᐴ",  = "ᐦᐹ",
	 = "ᐦᑌ",  = "ᐦᑎ",  = "ᐦᑐ",  = "ᐦᑕ",  = "ᐦᑏ",  = "ᐦᑑ",  = "ᐦᑖ",
	 = "ᐦᑫ",  = "ᐦᑭ",  = "ᐦᑯ",  = "ᐦᑲ",  = "ᐦᑮ",  = "ᐦᑰ",  = "ᐦᑳ",
	 = "ᐦᒉ",  = "ᐦᒋ",  = "ᐦᒍ",  = "ᐦᒐ",  = "ᐦᒌ",  = "ᐦᒎ",  = "ᐦᒑ",
	 = "ᐦᓭ",  = "ᐦᓯ",  = "ᐦᓱ",  = "ᐦᓴ",  = "ᐦᓰ",  = "ᐦᓲ",  = "ᐦᓵ",
	 = "ᐦᔐ",  = "ᐦᔑ",  = "ᐦᔓ",  = "ᐦᔕ",  = "ᐦᔒ",  = "ᐦᔔ",  = "ᐦᔖ",
	 = "ᐧᐁ",  = "ᐧᐃ",  = "ᐧᐅ",  = "ᐧᐊ",  = "ᐧᐄ",  = "ᐧᐆ",  = "ᐧᐋ",
	 = "ᑉ",  = "ᑉ",  = "ᑦ",  = "ᑦ",  = "ᒃ",  = "ᒃ",  = "ᒡ",  = "ᒡ",
     = "ᒻ",  = "ᓐ",  = "ᔅ",  = "ᔅ",  = "ᔥ",  = "ᔥ",  = "ᔾ",  = "ᐤ",  = "ᐦ"
}

local function translit(str)
	local Cans_str = ""
	local current_str = ""
	local next_symbol = ""
	for i = 1, #str do 
		current_str = current_str .. char_at(str, i)
		if syllables ~= nil then
			next_symbol = syllables
		else
			Cans_str = Cans_str .. next_symbol
			current_str = char_at(str, i)
		end
	end
	Cans_str = Cans_str .. next_symbol
	return Cans_str
end

function export.show(frame)
	text = frame.args or "anishinaabe"
	return translit(text)
end

return export