This module will transliterate Southern Yukaghir language text.
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:yux-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 u = mw.ustring.char
local MACRON = u(0x0304)
local DOTABOVE = u(0x0307)
local DOTBELOW = u(0x0323)
local str_gsub, ugsub = string.gsub, mw.ustring.gsub
local UTF8char = '*'
local export = {}
local tab = {
='A', ='a', ='B', ='b', ='W', ='w',
='G', ='g', ='H', ='h', ='D', ='d',
='Ž', ='ž', ='I', ='i', ='J', ='j',
='K', ='k', ='L', ='l', ='M', ='m',
='N', ='n', ='Ŋ', ='ŋ', ='O', ='o',
='Ø', ='ø', ='P', ='p', ='R', ='r',
='T', ='t', ='U', ='u', ='F', ='f',
='Q', ='q', ='Č', ='č', ='Š', ='š',
='E', ='e',
-- non-native letters
='Je', ='je',
='Jo', ='jo',
='Z', ='z',
='C', ='c',
='Ś', ='ś',
='Y', ='y',
='Ju', ='ju',
='Ja', ='ja',
="ʺ", ="ʺ",
='ʹ', ='ʹ',
='S', ='s'
}
local other = {
{ 'Аа', 'Ā' },
{ 'аа', 'ā' },
{ 'Ээ', 'Ē' },
{ 'ээ', 'ē' },
{ 'Ии', 'Ī' },
{ 'ии', 'ī' },
{ 'Оо', 'Ō' },
{ 'оо', 'ō' },
{ 'Уу', 'Ū' },
{ 'уу', 'ū' },
{ 'Өө', 'Ø̄'},
{ 'өө', 'ø̄'},
{ 'Оу', 'Ow'},
{ 'оу', 'ow'},
}
function export.tr(text, lang, sc)
for i, replacement in ipairs(other) do
text = str_gsub(text, unpack(replacement))
end
return (str_gsub(text, UTF8char, tab))
end
return export