跳转到内容

模組:Lydi-translit

維基詞典,自由的多語言詞典

這個模組會將呂底亞字母文字轉寫為拉丁字母。

最好不要直接從模板或其他模組調用此模組。要從模板中使用它,請以{{xlit}}做為替代;若要在模組中使用,則以Module:languages#Language:transliterate替代。

關於測試用例,請參閱Module:Lydi-translit/testcases

函數[编辑]

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 chars = {
	["𐤠"] = "a",
	["𐤵"] = "ã",
	["𐤡"] = "b",
	["𐤹"] = "c",
	["𐤣"] = "d",
	["𐤤"] = "e",
	["𐤶"] = "ẽ",
	["𐤱"] = "f",
	["𐤢"] = "g",
	["𐤦"] = "i",
	["𐤧"] = "y",
	["𐤨"] = "k",
	["𐤩"] = "l",
	["𐤷"] = "λ",
	["𐤪"] = "m",
	["𐤫"] = "n",
	["𐤸"] = "ν",
	["𐤬"] = "o",
	["𐤲"] = "q",
	["𐤭"] = "r",
	["𐤳"] = "s",
	["𐤮"] = "ś",
	["𐤯"] = "t",
	["𐤴"] = "τ",
	["𐤰"] = "u",
	["𐤥"] = "w",
}

function export.tr(text, lang, sc)
	return (mw.ustring.gsub(text, '.', chars))
end

return export