Module:Ital-translit
Documentation for this module may be created at Module:Ital-translit/doc
local export = {}
-- Standard transcription
local common_rules = {
['π'] = 'a',
['π'] = 'b',
['π'] = 'c',
['π'] = 'd',
['π'] = 'e',
['π
'] = 'v',
['π'] = 'z',
['π'] = 'h',
['π'] = 'ΞΈ',
['π'] = 'i',
['π'] = 'k',
['π'] = 'l',
['π'] = 'm',
['π'] = 'n',
['π'] = 'Ε‘',
['π'] = 'o',
['π'] = 'p',
['π'] = 'Ε',
['π'] = 'q',
['π'] = 'r',
['π'] = 's',
['π'] = 't',
['π'] = 'u',
['π'] = 'x',
['π'] = 'Ο',
['π'] = 'Ο',
['π'] = 'f',
['π'] = 'Ε',
['π'] = 'Γ§',
['π'] = 'Γ',
['π'] = 'ΓΊ',
['π'] = 'Ε',
-- Numerals
['π '] = 'β
',
['π‘'] = 'β
€',
['π’'] = 'β
©',
['π£'] = 'β
¬',
-- Punctuation
['Β·'] = ' ',
['β'] = ' ',
['β'] = ' ',
}
local lang_rules = {
-- Etruscan
['ett'] = {
['π'] = 'β
',
},
-- Old Latin
['itc-ola'] = {
['π
'] = 'f',
},
-- Noric
['nrc'] = {
['π'] = 'g',
['π'] = 'd',
['π'] = 'g',
},
-- North Picene
['nrp'] = {
['π'] = 'g',
},
-- Oscan
['osc'] = {
['π'] = 'g',
},
-- South Picene
['spx'] = {
['π'] = 'g',
['π'] = 'Γ',
},
-- Camunic
['xcc'] = {
['π'] = 'Ε',
['π'] = 'g',
['π'] = 'b',
['π'] = 's',
['π'] = 'ΓΎΓΎ',
['π£'] = 'ΓΎ',
},
-- Faliscan
['xfa'] = {
['π
'] = 'f', -- looks more like an up-arrow, but this is how it should be encoded
},
-- Raetic
['xrr'] = {
['π'] = 'ΓΎ',
['π'] = '?',
},
-- Umbrian
['xum'] = {
['π'] = 's',
},
-- Venetic
['xve'] = {
['π'] = 'j',
['π'] = 'd',
['π'] = 'b',
['π'] = 'g',
},
}
function export.tr(text, lang, sc)
-- If the script is not Ital, do not transliterate
if sc ~= "Ital" then
return
end
-- Transliterate language-specific exceptions
if lang == "xve" then
text = mw.ustring.gsub(text, 'ππ
', 'f')
end
if lang_rules[lang] then
text = mw.ustring.gsub(text, '.', lang_rules[lang])
end
-- Transliterate remaining characters
text = mw.ustring.gsub(text, '.', common_rules)
return text
end
return export