Module:Deranize: Difference between revisions

No change in size ,  19:26, 18 December 2022
reformat lookup table
(fix arity check at top of deranize())
(reformat lookup table)
Line 23: Line 23:
}
}


local deranitable = {
local deranimap = {
   -- consonants
   -- consonants
   m     = "", -- DERANI LETTER MAMEI
   ["m"]  = "", -- DERANI LETTER MAMEI
   m_   = "", -- DERANI LETTER MAMEI CODA
   ["m_"] = "", -- DERANI LETTER MAMEI CODA
   b     = "", -- DERANI LETTER BUBUE
   ["b"]  = "", -- DERANI LETTER BUBUE
   p     = "", -- DERANI LETTER PIPOQ
   ["p"]  = "", -- DERANI LETTER PIPOQ
   f     = "", -- DERANI LETTER FOFUAQ
   ["f"]  = "", -- DERANI LETTER FOFUAQ
   n     = "", -- DERANI LETTER NANAQ
   ["n"]  = "", -- DERANI LETTER NANAQ
   d     = "", -- DERANI LETTER DUDEO
   ["d"]  = "", -- DERANI LETTER DUDEO
   t     = "", -- DERANI LETTER TITIEQ
   ["t"]  = "", -- DERANI LETTER TITIEQ
   z     = "", -- DERANI LETTER ZOZEO
   ["z"]  = "", -- DERANI LETTER ZOZEO
   c     = "", -- DERANI LETTER CECOA
   ["c"]  = "", -- DERANI LETTER CECOA
   s     = "", -- DERANI LETTER SAQSEOQ
   ["s"]  = "", -- DERANI LETTER SAQSEOQ
   r     = "", -- DERANI LETTER RAIRUA
   ["r"]  = "", -- DERANI LETTER RAIRUA
   l     = "", -- DERANI LETTER LAOLIQ
   ["l"]  = "", -- DERANI LETTER LAOLIQ
   nh   = "", -- DERANI LETTER NHANHOQ
   ["nh"] = "", -- DERANI LETTER NHANHOQ
   j     = "", -- DERANI LETTER JUJUO
   ["j"]  = "", -- DERANI LETTER JUJUO
   ch   = "", -- DERANI LETTER CHICHAO
   ["ch"] = "", -- DERANI LETTER CHICHAO
   sh   = "", -- DERANI LETTER SHOSHIA
   ["sh"] = "", -- DERANI LETTER SHOSHIA
   ["ꝡ"] = "", -- DERANI LETTER VEVA
   ["ꝡ"] = "", -- DERANI LETTER VEVA
   q_   = "", -- DERANI LETTER AQ-AQ
   ["q_"] = "", -- DERANI LETTER AQ-AQ
   g     = "", -- DERANI LETTER GUGUI
   ["g"]  = "", -- DERANI LETTER GUGUI
   k     = "", -- DERANI LETTER KIKUE
   ["k"]  = "", -- DERANI LETTER KIKUE
   ["'"] = "", -- DERANI LETTER O-AOMO
   ["'"] = "", -- DERANI LETTER O-AOMO
   h     = "", -- DERANI LETTER HEHAQ
   ["h"]  = "", -- DERANI LETTER HEHAQ
   -- vowels
   -- vowels
   a     = "", -- DERANI LETTER SAQSEOQ
   ["a"]  = "", -- DERANI LETTER SAQSEOQ
   ["ı"] = "", -- DERANI LETTER CECOA
   ["ı"] = "", -- DERANI LETTER CECOA
   u     = "", -- DERANI LETTER BUBUE
   ["u"]  = "", -- DERANI LETTER BUBUE
   o     = "", -- DERANI LETTER GUGUI
   ["o"]  = "", -- DERANI LETTER GUGUI
   e     = "", -- DERANI LETTER FOFUAQ
   ["e"]  = "", -- DERANI LETTER FOFUAQ
   -- tone marks
   -- tone marks
   [2]   = "", -- DERANI COMBINING RISING TONE
   [2]   = "", -- DERANI COMBINING RISING TONE
   [3]   = "", -- DERANI COMBINING LOW GLOTTAL TONE
   [3]   = "", -- DERANI COMBINING LOW GLOTTAL TONE
   [4]   = "", -- DERANI COMBINING RISING-FALLING TONE
   [4]   = "", -- DERANI COMBINING RISING-FALLING TONE
   -- TODO: the rest of the owl
   -- TODO: the rest of the owl
}
}
Line 98: Line 98:
     end
     end
     for _, glyph in ipairs(glyphs) do
     for _, glyph in ipairs(glyphs) do
       local mapped = deranitable[glyph]
       local mapped = deranimap[glyph]
       if mapped then
       if mapped then
       res[#res+1] = mapped
       res[#res+1] = mapped
Line 108: Line 108:
end
end


return {deranitable = deranitable, deranize = deranize}
return {deranize = deranize}