Module:Palm-translit
- 下列说明文档位于Module:Palm-translit/doc。[编辑]
- 相关链接:子页面列表 • 链入 • 嵌入包含 • 测试用例 • 沙盒
这个模组会将帕尔迈拉字母文字转写为拉丁字母。
最好不要直接从模板或其他模组调用此模组。要从模板中使用它,请以{{xlit}}
做为替代;若要在模组中使用,则以Module:languages#Language:transliterate替代。
关于测试用例,请参阅Module:Palm-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 tt = {
["𐡠"] = "ʾ", -- aleph
["𐡡"] = "b", -- beth
["𐡢"] = "g", -- gimel
["𐡣"] = "d", -- daleth
["𐡤"] = "h", -- he
["𐡥"] = "w", -- waw
["𐡦"] = "z", -- zayin
["𐡧"] = "ḥ", -- heth
["𐡨"] = "ṭ", -- teth
["𐡩"] = "y", -- yodh
["𐡪"] = "k", -- kaph
["𐡫"] = "l", -- lamedh
["𐡬"] = "m", -- mem
["𐡭"] = "n", -- final nun
["𐡮"] = "n", -- nun
["𐡯"] = "s", -- samekh
["𐡰"] = "ʿ", -- ayin
["𐡱"] = "p", -- pe
["𐡲"] = "ṣ", -- sadhe
["𐡳"] = "q", -- qoph
["𐡴"] = "r", -- resh
["𐡵"] = "š", -- shin
["𐡶"] = "t", -- taw
["𐡷"] = "☙", -- left-pointing fleuron
["𐡸"] = "❧", -- right-pointing fleuron
["𐡹"] = "1", -- one
["𐡺"] = "2", -- two
["𐡻"] = "3", -- three
["𐡼"] = "4", -- four
["𐡽"] = "5", -- five
["𐡾"] = "10", -- ten
["𐡿"] = "20", -- twenty
}
function export.tr(text, lang, sc)
if sc ~= "Palm" then
return
end
-- Transliterate characters
text = mw.ustring.gsub(text, '.', tt)
return text
end
return export