Module:Lydi-translit
- 下列说明文档位于Module:Lydi-translit/doc。[编辑]
- 相关链接:子页面列表 • 链入 • 嵌入包含 • 测试用例 • 沙盒
这个模组会将吕底亚字母文字转写为拉丁字母。
最好不要直接从模板或其他模组调用此模组。要从模板中使用它,请以{{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 codesc
, and language specified by the codelang
. When the transliteration fails, returnsnil
.
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