This module will transliterate text in the Samaritan script. It is used to transliterate Samaritan Aramaic.
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:Samr-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 = require("Module:string/char")
local ugsub = mw.ustring.gsub
local cons_list = 'ʾbgdhwbzḥṭyklmnsʿfpṣqršt'
local cons = ''
local export = {}
local tt = {
= {
-- occlusion
= 'b',
= 'p',
},
= {
-- consonants
= 'ʾ', -- ALAF
= 'b', -- BIT
= 'g', -- GAMAN
= 'd', -- DALAT
= 'h', -- IY
= 'w', -- BAA
= 'z', -- ZEN
= 'ḥ', -- IT
= 'ṭ', -- TIT
= 'y', -- YUT
= 'k', -- KAAF
= 'l', -- LABAT
= 'm', -- MIM
= 'n', -- NUN
= 's', -- SINGAAT
= 'ʿ', -- IN
= 'f', -- FI
= 'ṣ', -- TSAADIY
= 'q', -- QUF
= 'r', -- RISH
= 'š', -- SHAN
= 't', -- TAAF
-- consonant modifier
= 'ʿ', -- IN
= 'ʿ', -- IN-ALAF
= 'ỹ', -- MODIFIER EPENTHETIC YUT
= 'ỹ', -- EPENTHETIC YUT
-- vowel signs
= 'ê', -- LONG E
= 'e', -- E
= 'å̂ː', -- OVERLONG AA
= 'å̂', -- LONG AA
= 'å', -- AA
= 'âː', -- OVERLONG A
= 'â', -- LONG A
= 'a', -- A
= 'ă', -- MODIFIER SHORT A
= 'ă', -- SHORT A
= 'u', -- U
= 'û', -- LONG U
= 'i', -- MODIFIER LETTER I
= 'î', -- LONG I
= 'i', -- I
= 'o', -- O
= '', -- SUKUN
-- punctuation
= ' ', -- PUNCTUATION NEQUDAA
},
= {
-- consonant with dagesh
= '%1%1',
},
}
function export.tr(text, lang, sc)
for _, replacements in ipairs(tt) do
for regex, replacement in pairs(replacements) do
text = ugsub(text, regex, replacement)
end
end
return text
end
return export