This module will transliterate text in the Linear B script. It is used to transliterate Mycenaean Greek.
The module should preferably not be called directly from templates or other modules.
To use it from a template, use {{xlit}}
.
Within a module, use Module:languages#Language:transliterate.
For testcases, see Module:Linb-translit/testcases.
tr(text, lang, sc)
text
written in the script specified by the code sc
, and language specified by the code lang
.nil
.local export = {}
local chars = {
= "a",
= "e",
= "i",
= "o",
= "u",
= "da",
= "de",
= "di",
= "do",
= "du",
= "ja",
= "je",
-- ji not in Unicode
= "jo",
= "ju",
= "ka",
= "ke",
= "ki",
= "ko",
= "ku",
= "ma",
= "me",
= "mi",
= "mo",
= "mu",
= "na",
= "ne",
= "ni",
= "no",
= "nu",
= "pa",
= "pe",
= "pi",
= "po",
= "pu",
= "qa",
= "qe",
= "qi",
= "qo",
-- qu not in Unicode
= "ra",
= "re",
= "ri",
= "ro",
= "ru",
= "sa",
= "se",
= "si",
= "so",
= "su",
= "ta",
= "te",
= "ti",
= "to",
= "tu",
= "wa",
= "we",
= "wi",
= "wo",
-- wu not in Unicode
= "za",
= "ze",
-- zi not in Unicode
= "zo",
-- zu not in Unicode
= "ha",
= "ai",
= "au",
= "dwe",
= "dwo",
= "nwo",
= "phu",
= "pte",
= "rya",
= "rai",
= "ryo",
= "tya",
= "twe",
= "two",
= "*18",
= "*19",
= "*22",
= "*34",
= "*47",
= "*49",
= "*56",
= "*63",
= "*64",
= "*79",
= "*82",
= "*83",
= "*86",
= "*89",
-- explicit morpheme boundary
= "`",
}
function export.tr(text, lang, sc)
local ret = {}
local i = 1
for c in string.gmatch(text, "*") do -- UTF-8 character pattern
ret = chars or c
i = i + 1
end
text = string.gsub(table.concat(ret, "-"), "%- %-", " ")
text = string.gsub(text, "%-?`%-?", "-")
return text
end
return export