function Morse(ori) MorseMapping = { ["a"] = ".−", ["b"] = "−...", ["c"] = "−.−.", ["d"] = "−..", ["e"] = ".", ["f"] = "..−.", ["g"] = "−−.", ["h"] = "....", ["i"] = "..", ["j"] = ".−−−", ["k"] = "−.−", ["l"] = ".−..", ["m"] = "−−", ["n"] = "−.", ["o"] = "−−−", ["p"] = ".−−.", ["q"] = "−−.−", ["r"] = ".−.", ["s"] = "...", ["t"] = "−", ["u"] = "..−", ["v"] = "...−", ["w"] = ".−−", ["x"] = "−..−", ["y"] = "−.−−", ["z"] = "−−..", ["0"] = "−−−−−", ["1"] = ".−−−−", ["2"] = "..−−−", ["3"] = "...−−", ["4"] = "....−", ["5"] = ".....", ["6"] = "−....", ["7"] = "−−...", ["8"] = "−−−..", ["9"] = "−−−−.", ["."] = ".−.−.−", [","] = "−−..−−", ["?"] = "..−−..", ["'"] = ".−−−−.", ["!"] = "−.−.−−", ["/"] = "−..−.", ["("] = "−.−−.", [")"] = "−.−−.−", ["&"] = ".−...", [":"] = "−−−...", [";"] = "−.−.−.", ["="] = "−...−", ["+"] = ".−.−.", ["-"] = "−....−", ["_"] = "..−−.−", ["\""] = ".−..−.", ["$"] = "...−..−", ["@"] = ".−−.−.", ["_"] = "/" } if #ori == 0 then return end local result = "" ori = string.lower(ori) for c in ori:gmatch"." do result = result .. MorseMapping[c] .. " " end result = result .. "/ " return {result, string.sub(result, 0, string.len(result) - 3)} end ime.register_command("mo", "Morse", "摩尔斯电码", "none")