Modul:Ital-translit
- 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 Old Italic. Ia digunakan untuk mentransliterasi Etruscan, North Picene, Oscan, South Picene, Camunic, Faliscan, Lemnian, Lepontic, Raetic, Umbrian, 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
suntingtr(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, 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