Translate a string into morse code.
Your task is to write a program that takes a string as input and translates it into its equivalent in international Morse code. The input will be a string of lowercase space-separated words where each word consists of nothing but the letters a-z. Add spaces between the words but not between the letters of a word in morse code. Here is the alphabet in morse code:
a: .- g: --. m: -- s: ... y: -.--
b: -... h: .... n: -. t: - z: --..
c: -.-. i: .. o: --- u: ..-
d: -.. j: .--- p: .--. v: ...-
e: . k: -.- q: --.- w: .--
f: ..-. l: .-.. r: .-. x: -..-
For example, the string
lorem ipsum
should be translated to
.-..---.-..-- ...--......---
# | Size | % | Users |
|---|---|---|---|
#1 | 99 c. | Top 3% | |
#2 | 101 c. | Top 7% | |
#3 | 102 c. | Top 10% | |
#4 | 113 c. | Top 14% | |
#5 | 116 c. | Top 17% | |
#6 | 124 c. | Top 21% | |
#7 | 130 c. | Top 24% | |
#8 | 133 c. | Top 28% | |
#9 | 136 c. | Top 31% | |
#10 | 139 c. | Top 34% | |
#11 | 140 c. | Top 38% | |
#12 | 145 c. | Top 41% | |
#13 | 150 c. | Top 45% | |
#14 | 162 c. | Top 52% | |
#15 | 166 c. | Top 55% | |
#16 | 169 c. | Top 59% | |
#17 | 170 c. | Top 62% | |
#18 | 172 c. | Top 66% | |
#19 | 174 c. | Top 69% | |
#20 | 182 c. | Top 72% | |
#21 | 186 c. | Top 76% | |
#22 | 195 c. | Top 79% | |
#23 | 200 c. | Top 83% | |
#24 | 219 c. | Top 86% | |
#25 | 258 c. | Top 90% | |
#26 | 427 c. | Top 93% | |
#27 | 593 c. | Top 97% | |
#28 | 606 c. | Top 100% |