Outline
"Hello World" is Morse Code is:
.... . .-.. .-.. --- / .-- --- .-. .-.. -.. H E L L O SPACE W O R L D
We can then make this into a string with an 'x' between characters:
Plain text: H e l l o w o r l d Morse string: ....x.x.-..x.-..x---xx.--x---x.-.x.-..x-..
We can now use three-character mappings to convert them back to text:
['...', '..-', '..x', '.-.', '.--', '.-x', '.x.', '.x-', '.xx', '-..', '-.-', '-.x', '--.', '---', '--x', '-x.', '-x-','-xx', 'x..', 'x.-', 'x.x', 'x-.', 'x--', 'x-x', 'xx.', 'xx-']
This mapping is:
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 . . . . . . . . . - - - - - - - - - x x x x x x x x . . . - - - x x x . . . - - - x x x . . . - - - x x . - x . - x . - x . - x . - x . - x . - x . - x . -
which will map to "ABCDEF...Z". Next we can convert them back with:
AGTCDHOTQODTCJ
For "Peter piper picked " we get:
.--.x.x-x.x.-.xx.--.x..x.--.x.x.-.xx.--.x..x-.-.x-.-x.x-..xx P e t e r ' ' p i p e r' ' p i c k e d ' '
Standard Morse code
E . S ... H .... B -... 1 .---- period .-.-.- T - U ..- V ...- X-..- 2 ..--- comma --..-- I .. R .-. F ..-. C-.-. 3 ...-- query .-.-.- A .- W .-- L .-.. Y --.- 4 ....- colon ---... N -. D -.. P .--. Z --.. 5 ..... s/colon -.-.-. M -- K -.- J .--- Q --.- 6 -.... dash -....- G --. 7 --... slash -..-. O --- 8 ---.. equals -...- 9 ----. 0 -----