Module:ko-translit/sandbox

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


local export = {}
local gsub = mw.ustring.gsub
local match = mw.ustring.match

function export.tr(word, lang, sc)
	word = gsub(word, "%<%/?r%>", "")
	word = gsub(word, "%<%/?ruby%>", "")
	-- remove hanja from (ex.) 사전(辭典) and 辭典(사전)
	-- Hani regex is a reasonable subset of Hani from ],
	-- last checked on 20220221
	word = gsub(word, "%(+%)", "")
	word = gsub(word, "%(*'''+'''*%)", "")
	word = gsub(word, "+%((.-)%)", "%1")

	-- transform em-dash to plain hyphen-minus
	word = gsub(word, "—", "-")
	
	if match(word, "^+$") then
		return (gsub(word,
			"", {
				 = "g",  = "kk",  = "ks",  = "n",  = "nj",  = "nh",  = "d",  = "tt",  = "l",  = "lg",
				 = "lm",  = "lb",  = "ls",  = "lt",  = "lp",  = "lh",  = "m",  = "b",  = "pp",  = "ps",
				 = "s",  = "ss",  = "'",  = "j",  = "jj",  = "ch",  = "k",  = "t",  = "p",  = "h",
				 = "a",  = "ae",  = "ya",  = "yae",  = "eo",  = "e",  = "yeo",
				 = "ye",  = "o",  = "wa",  = "wae",  = "oe",  = "yo",  = "u",
				 = "wo",  = "we",  = "wi",  = "yu",  = "eu",  = "ui",  = "i" }
		))
	end
	
	if not match(word, "+") then
		return nil
	end
	
	local m_pron = require("Module:ko-pron")
	local revised = m_pron.romanise(word, 2, {}, true)
	
	if not revised then
		return nil
	end
	
	if match(revised, "") then
		revised = mw.ustring.upper(mw.ustring.sub(revised, 1, 1)) .. mw.ustring.sub(revised, 2, -1)
		revised = gsub(revised, "() ()", "%1 ^%2")
		revised = gsub(revised, "^%'%'%'", "'''^")
	end
	revised = gsub(revised, "()%-%'()", "%1-%2")
	revised = gsub(revised, "%^%'%'%'", "'''^")
	revised = gsub(revised, "%^%l", mw.ustring.upper)
	revised = gsub(revised, '%^', '')
	revised = gsub(revised, "%-'''%-", "'''-")
	revised = gsub(revised, "%-%-", "-")
	
	return revised
end

export.tr_revised = export.tr

return export