Bước tới nội dung

Mô đun:Runr-translit

Từ điển mở Wiktionary
local export = {}

local letters = {}

local export = {}

local letters = {}

-- Elder futhark
letters["gmq-pro"] = {
	["ᚠ"]='f',
	["ᚢ"]='u',
	["ᚦ"]='þ',
	["ᚨ"]='a',
	["ᚱ"]='r',
	["ᚲ"]='k', ["ᚳ"]='k', ['ᚴ']='k',--transitional period
	["ᚷ"]='g',
	["ᚹ"]='w',
	["ᚺ"]='h', ["ᚻ"]='h',
	["ᚾ"]='n',
	["ᛁ"]='i',
	["ᛃ"]='j', ["ᛡ"]='ᴀ',--transitional period
	["ᛇ"]='ï',
	["ᛈ"]='p',
	["ᛉ"]='ʀ', ["ᛦ"]='ʀ',--transitional period
	["ᛊ"]='s', ["ᛋ"]='s',
	["ᛏ"]='t',
	["ᛒ"]='b',
	["ᛖ"]='e',
	["ᛗ"]='m',
	["ᛚ"]='l',
	["ᛜ"]='ŋ', ["ᛝ"]="ŋ",
	["ᛟ"]='o',
	["ᛞ"]='d',
}

-- Old High German
letters["goh"] = {
	["ᚠ"]='f',
	["ᚢ"]='u',
	["ᚦ"]='þ',
	["ᚨ"]='a',
	["ᚱ"]='r',
	["ᚲ"]='k', ["ᚳ"]='k', ['ᚴ']='k',
	["ᚷ"]='g',
	["ᚹ"]='w',
	["ᚺ"]='h', ["ᚻ"]='h',
	["ᚾ"]='n',
	["ᛁ"]='i',
	["ᛃ"]='j',
	["ᛇ"]='ï',
	["ᛈ"]='p',
	["ᛊ"]='s', ["ᛋ"]='s',
	["ᛏ"]='t',
	["ᛒ"]='b',
	["ᛖ"]='e',
	["ᛗ"]='m',
	["ᛚ"]='l',
	["ᛜ"]='ŋ', ["ᛝ"]="ŋ",
	["ᛟ"]='o',
	["ᛞ"]='d'
}

-- Anglo-Saxon futhorc
letters["ang"] = {
	["ᚠ"]="f",
	["ᚢ"]="u",
	["ᚦ"]="þ",
	["ᚩ"]="ó",
	["ᚱ"]="r",
	["ᚳ"]="c",
	["ᚷ"]="ġ",["ᚸ"]="g",
	["ᚹ"]="w",
	["ᚺ"]='h', ["ᚻ"]='h',
	["ᚾ"]="n",
	["ᛁ"]="i",
	["ᛄ"]="j",
	["ᛇ"]="eo",
	["ᛈ"]="p",
	["ᛉ"]="x",
	["ᛋ"]="s",
	["ᛏ"]="t",
	["ᛒ"]="b",
	["ᛖ"]="e",
	["ᛗ"]="m",
	["ᛚ"]="l",
	["ᛜ"]='ŋ', ["ᛝ"]="ŋ",
	["ᛟ"]="œ",
	["ᛞ"]="d",
	["ᚪ"]="a",
	["ᚫ"]="æ",
	["ᚣ"]="y",
	["ᛡ"]="io",
	["ᛠ"]="ea"
}

-- Younger futhark, including later stung or otherwise modified variants
letters["non"] = {
	["ᚠ"]="f", ["ᚡ"]="v",
	["ᚢ"]="u", ["ᚤ"]="y",
	["ᚦ"]="þ", ["ᚧ"]="ð",
	["ᚬ"]="ą", ["ᚭ"]="ą", ["ᚨ"]="ą", ["ᚮ"]="o", ["ᚯ"]="ø", ["ᚰ"]="ǫ",
	["ᚱ"]="r",
	["ᚴ"]="k", ["ᚵ"]="g",
	["ᚼ"]="h", ["ᚽ"]="h",
	["ᚾ"]="n", ["ᚿ"]="n",
	["ᛁ"]="i", ["ᛂ"]="e",
	["ᛅ"]="a", ["ᛆ"]="a", ["ᛡ"]='ᴀ',
	["ᛋ"]="s", ["ᛌ"]="s",
	["ᛏ"]="t", ["ᛐ"]="t", ["ᛑ"]="d",
	["ᛒ"]="b", ["ᛓ"]="b", ["ᛕ"]="p", ["ᛔ"]="p",
	["ᛘ"]="m", ["ᛙ"]="m",
	["ᛚ"]="l",
	["ᛦ"]="ʀ", ["ᛧ"]="ʀ",
	
	--certain Elder Futhark letters exist in early Old Norse inscriptions
	["ᚷ"]='ɢ',
	["ᚹ"]='w',
	["ᚺ"]='ʜ',
	["ᛖ"]='ᴇ',
	["ᛗ"]='ᴍ',
	["ᛞ"]='ᴅ',
	["ᛟ"]='ᴏ'
}

-- Old Danish
letters["gmq-oda"] = {
	["ᚠ"]="f", ["ᚡ"]="v",
	["ᚢ"]="u", ["ᚤ"]="y",
	["ᚦ"]="þ", ["ᚧ"]="ð",
	["ᚮ"]="o", ["ᚯ"]="ø",
	["ᚱ"]="r",
	["ᚴ"]="k", ["ᚵ"]="g",
	["ᚼ"]="h", ["ᚽ"]="h",
	["ᚾ"]="n", ["ᚿ"]="n",
	["ᛁ"]="i", ["ᛂ"]="e",
	["ᛅ"]="æ", ["ᛆ"]="a",
	["ᛋ"]="s", ["ᛌ"]="s",
	["ᛏ"]="t", ["ᛐ"]="t", ["ᛑ"]="d",
	["ᛒ"]="b", ["ᛓ"]="b", ["ᛕ"]="p", ["ᛔ"]="p",
	["ᛘ"]="m", ["ᛙ"]="m",
	["ᛚ"]="l",
	["ᛦ"]="y", ["ᛧ"]="ʀ",
}

function export.tr(text, lang, sc)
	if letters[lang] then
		return (mw.ustring.gsub(text, ".", letters[lang]))
	end

	return nil
end

return export