Module:Deranize: Difference between revisions

add diphthong mark in VF sequences
m (clean :s)
(add diphthong mark in VF sequences)
 
(4 intermediate revisions by the same user not shown)
Line 70: Line 70:
   ["]"] = "󱛙",
   ["]"] = "󱛙",
   ["*"] = " 󱛚",
   ["*"] = " 󱛚",
   ["_"] = "󱛛",
   ["_"] = "󱛛", -- compatibility nbsp
}
}


Line 108: Line 108:
       glyphs[#glyphs+1] = "hiatus"
       glyphs[#glyphs+1] = "hiatus"
     end
     end
     for _, fin in ipairs(mw.text.split(final, "")) do
     for j, fin in ipairs(mw.text.split(final, "")) do
      if j > 1 then glyphs[#glyphs+1] = "diphthong" end
       glyphs[#glyphs+1] = fin
       glyphs[#glyphs+1] = fin
     end
     end
Line 139: Line 140:
   assert(frame.args[1] ~= nil and frame.args[2] == nil, "This function requires exactly one argument")
   assert(frame.args[1] ~= nil and frame.args[2] == nil, "This function requires exactly one argument")
   local cleaned = u.gsub(frame.args[1], "[:%[%]*]", "")
   local cleaned = u.gsub(frame.args[1], "[:%[%]*]", "")
  local nbsp = string.char(0xC2, 0xA0)
  cleaned = u.gsub(cleaned, "_", nbsp)
   return cleaned
   return cleaned
end
end


return {deranize = deranize, clean = clean}
return {deranize = deranize, clean = clean}