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 | 101 c. | Top 4% | |
#2 | 102 c. | Top 7% | |
#3 | 113 c. | Top 11% | |
#4 | 116 c. | Top 14% | |
#5 | 123 c. | Top 18% | |
#6 | 124 c. | Top 21% | |
#7 | 130 c. | Top 25% | |
#8 | 133 c. | Top 29% | |
#9 | 136 c. | Top 32% | |
#10 | 139 c. | Top 36% | |
#11 | 140 c. | Top 39% | |
#12 | 145 c. | Top 43% | |
#13 | 150 c. | Top 46% | |
#14 | 162 c. | Top 54% | |
#15 | 166 c. | Top 57% | |
#16 | 170 c. | Top 61% | |
#17 | 172 c. | Top 64% | |
#18 | 174 c. | Top 68% | |
#19 | 182 c. | Top 71% | |
#20 | 186 c. | Top 75% | |
#21 | 195 c. | Top 79% | |
#22 | 200 c. | Top 82% | |
#23 | 219 c. | Top 86% | |
#24 | 258 c. | Top 89% | |
#25 | 427 c. | Top 93% | |
#26 | 593 c. | Top 96% | |
#27 | 606 c. | Top 100% |