local export = {}
local DN2SiddhamRules = {
-- 輔音字母
["क"]="𑖎", ["ख"]="𑖏", ["ग"]="𑖐", ["घ"]="𑖑", ["ङ"]="𑖒",
["च"]="𑖓", ["छ"]="𑖔", ["ज"]="𑖕", ["झ"]="𑖖", ["ञ"]="𑖗",
["ट"]="𑖘", ["ठ"]="𑖙", ["ड"]="𑖚", ["ढ"]="𑖛", ["ण"]="𑖜",
["त"]="𑖝", ["थ"]="𑖞", ["द"]="𑖟", ["ध"]="𑖠", ["न"]="𑖡", ["ऩ"]="𑖡𑗀[[分類:可能有錯的梵文轉換|ऩ𑖡]]",
["प"]="𑖢", ["फ"]="𑖣", ["ब"]="𑖤", ["भ"]="𑖥", ["म"]="𑖦",
["य"]="𑖧", ["र"]="𑖨", ["ल"]="𑖩", ["व"]="𑖪",
["ऱ"]="𑖨𑗀[[分類:可能有錯的梵文轉換|ऱ𑖨]]", ["ळ"]="𑖩𑗀[[分類:可能有錯的梵文轉換|ळ𑖩]]", ["ऴ"]="𑖩𑗀[[分類:可能有錯的梵文轉換|ऴ𑖩]]",
["श"]="𑖫", ["ष"]="𑖬", ["स"]="𑖭", ["ह"]="𑖮",
-- 元音附標符號
["ा"]="𑖯", ["ि"]="𑖰", ["ी"]="𑖱", ["ु"]="𑖲", ["ू"]="𑖳",
["ृ"]="𑖴", ["ॄ"]="𑖵", ["े"]="𑖸", ["ै"]="𑖹", ["ो"]="𑖺", ["ौ"]="𑖻", ["्"]="𑖿",
["ऺ"]="轉換出錯[[分類:可能有錯的梵文轉換|元]]", ["ऻ"]="轉換出錯[[分類:可能有錯的梵文轉換|元]]", ["ॅ"]="轉換出錯[[分類:可能有錯的梵文轉換|元]]", ["ॆ"]="轉換出錯[[分類:可能有錯的梵文轉換|元]]", ["ॉ"]="轉換出錯[[分類:可能有錯的梵文轉換|元]]", ["ॊ"]="轉換出錯[[分類:可能有錯的梵文轉換|元]]", ["ॎ"]="轉換出錯[[分類:可能有錯的梵文轉換|元]]", ["ॏ"]="轉換出錯[[分類:可能有錯的梵文轉換|元]]", ["ॕ"]="轉換出錯[[分類:可能有錯的梵文轉換|元]]", ["ॖ"]="轉換出錯[[分類:可能有錯的梵文轉換|元]]", ["ॗ"]="轉換出錯[[分類:可能有錯的梵文轉換|元]]",
-- 獨立元音字母
--["𑖀"]="अ", ["𑖁"]="आ", ["𑖂"]="इ", ["𑖃"]="ई", ["𑖄"]="उ", ["𑖅"]="ऊ",
["अ"]="𑖀", ["आ"]="𑖁", ["इ"]="𑖂", ["ई"]="𑖃", ["उ"]="𑖄", ["ऊ"]="𑖅",
["ऋ"]="𑖆", ["ऌ"]="𑖈", ["ए"]="𑖊", ["ऐ"]="𑖋", ["ओ"]="𑖌", ["औ"]="𑖍", ["ॐ"]="𑖌𑖼",
-- 特殊符號
["़"]="𑗀", ["ँ"]="𑖼", ["ं"]="𑖽", ["ः"]="𑖾", [""]="𑗄", [""]="𑗄",
--ऀऽॐ ॒॑ [[分類:可能有錯的梵文轉換|吠陀]]
}
function export.DN2Siddham(text)
local text = text.args[1]
text = mw.ustring.toNFC(text)
return (mw.ustring.gsub(text, '.', DN2SiddhamRules))
end
local Siddham2BodSubscriptRules =
{
['𑖿𑖎']='ྐ', ['𑖿𑖏']='ྑ', ['𑖿𑖐']='ྒ', ['𑖿𑖑']='ྒྷ', ['𑖿𑖒']='ྔ',
['𑖿𑖓']='ྩ', ['𑖿𑖔']='ྪ', ['𑖿𑖕']='ྫ', ['𑖿𑖖']='ྫྷ', ['𑖿𑖗']='ྙ',
['𑖿𑖘']='ྚ', ['𑖿𑖙']='ྛ', ['𑖿𑖚']='ྜ', ['𑖿𑖛']='ྜྷ', ['𑖿𑖜']='ྞ',
['𑖿𑖝']='ྟ', ['𑖿𑖞']='ྠ', ['𑖿𑖟']='ྡ', ['𑖿𑖠']='ྡྷ', ['𑖿𑖡']='ྣ',
['𑖿𑖢']='ྤ', ['𑖿𑖣']='ྥ', ['𑖿𑖤']='ྦ', ['𑖿𑖥']='ྦྷ', ['𑖿𑖦']='ྨ',
['𑖿𑖧']='ྻ', ['𑖿𑖨']='ྼ', ['𑖿𑖩']='ླ', ['𑖿𑖪']='ྺ',
['𑖿𑖫']='ྴ', ['𑖿𑖬']='ྵ', ['𑖿𑖭']='ྶ', ['𑖿𑖮']='ྷ',
['𑖿𑖀']='ྸ' --ྱྲྭ
}
local Siddham2BodPrimaryRules =
{
-- 輔音字母
['𑖎']='ཀ', ['𑖏']='ཁ', ['𑖐']='ག', ['𑖑']='གྷ', ['𑖒']='ང',
['𑖓']='ཙ', ['𑖔']='ཚ', ['𑖕']='ཛ', ['𑖖']='ཛྷ', ['𑖗']='ཉ',
['𑖘']='ཊ', ['𑖙']='ཋ', ['𑖚']='ཌ', ['𑖛']='ཌྷ', ['𑖜']='ཎ',
['𑖝']='ཏ', ['𑖞']='ཐ', ['𑖟']='ད', ['𑖠']='དྷ', ['𑖡']='ན',
['𑖢']='པ', ['𑖣']='ཕ', ['𑖤']='བ', ['𑖥']='བྷ', ['𑖦']='མ',
['𑖧']='ཡ', ['𑖨']='ར', ['𑖩']='ལ', ['𑖪']='ཝ',
['𑖫']='ཤ', ['𑖬']='ཥ', ['𑖭']='ས', ['𑖮']='ཧ',
-- 元音附標符號
['𑖿']='྄', ['𑖯']='ཱ',
['𑖰']='ི', ['𑖱']='ཱི',
['𑖲']='ུ', ['𑖳']='ཱུ',
['𑖴']='ྲྀ', ['𑖵']='ྲཱྀ',
['ॢ']='ླྀ', ['ॣ']='ླཱྀ',
['𑖸']='ེ', ['𑖹']='ཻ',
['𑖺']='ོ', ['𑖻']='ཽ'
-- 獨立元音字母
-- 特殊符號
}
function export.Siddham2Bod(frame)
local text = frame.args[1]
text = mw.ustring.toNFC(text)
text = mw.ustring.gsub(text, '([𑖿])'..'([𑖎𑖏𑖐𑖑𑖒𑖓𑖔𑖕𑖖𑖗𑖘𑖙𑖚𑖛𑖜𑖝𑖞𑖟𑖠𑖡𑖢𑖣𑖤𑖥𑖦𑖧𑖨𑖩𑖪𑖫𑖬𑖭𑖮𑖀])',
function(c,d)
return Siddham2BodSubscriptRules[c..d]
end)
text = mw.ustring.gsub(text, '.', Siddham2BodPrimaryRules)
return (text)
end
return export