Modul:Ital-translit
Penampilan
- Berikut merupakan pendokumenan yang dijana oleh Modul:pendokumenan/functions/translit. [sunting]
- Pautan berguna: senarai sublaman • pautan • transklusi • kes ujian • kotak pasir
Modul ini akan mentransliterasi teks dalam Tulisan Italik Kuno. Ia digunakan untuk mentransliterasi bahasa Etruscan, Picenum Utara, Osci, Picenum Selatan, Camunic, Falisci, Lemnos, Lepontii, Raetic, Umbri, and Venetic.
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:Ital-translit/testcases.
Functions
[sunting]tr(text, lang, sc)- Transliterates a given piece of
textwritten in the script specified by the codesc, and language specified by the codelang. - When the transliteration fails, returns
nil.
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',
['𐌛'] = 'ř',
['𐌜'] = 'ç',
['𐌝'] = 'í',
['𐌞'] = 'ú',
['𐌟'] = 'k',
-- Numerals
['𐌠'] = 'Ⅰ',
['𐌡'] = 'Ⅴ',
['𐌢'] = 'Ⅹ',
['𐌣'] = 'Ⅼ',
-- Punctuation
['·'] = ' ',
['⁚'] = ' ',
['⁝'] = ' ',
}
local lang_rules = {
['ett'] = { -- Etruscan
['𐌟'] = 'Ⅽ',
};
['itc-ola'] = { -- Old Latin
['𐌅'] = 'f',
};
['nrc'] = { -- Noric
['𐌂'] = 'g',
['𐌈'] = 'd',
['𐌙'] = 'g',
};
['nrp'] = { -- North Picene
['𐌂'] = 'g',
};
['osc'] = { -- Oscan
['𐌂'] = 'g',
};
['spx'] = { -- South Picene
['𐌂'] = 'g',
['𐌑'] = 'í',
['·'] = 'o',
['⁚'] = 'f',
};
['xcc'] = { -- Camunic
['𐌁'] = 'ś',
['𐌂'] = 'g',
['𐌑'] = 'b',
['𐌙'] = 's',
['𐌟'] = 'þþ',
['𐌣'] = 'þ',
};
['xrr'] = { -- Raetic
['𐌁'] = 'þ',
['𐌂'] = '?',
};
['xum'] = { -- Umbrian
['𐌈'] = 't',
};
['xve'] = { -- Venetic
['𐌂'] = 'j',
['𐌆'] = 'd',
['𐌇𐌅'] = 'f',
['𐌘'] = '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
Kategori:
- Tulisan Italik Kuno
- Modul transliterasi mengikut tulisan
- Modul bahasa Tulisan Italik Kuno
- Modul transliterasi
- Modul bahasa Venetic
- Modul bahasa Etruscan
- Modul bahasa Osci
- Modul bahasa Lemnos
- Modul bahasa Picenum Utara
- Modul bahasa Umbri
- Modul bahasa Falisci
- Modul bahasa Raetic
- Modul bahasa Picenum Selatan
- Modul bahasa Camunic
- Modul bahasa Lepontii