# I thought morse code was dead?

My computer went on the fritz earlier today and all of my messages were being sent in what looked like morse code. I recorded a few test messages to confirm my suspicions once the anomaly ended and to my surprise, it's not quite morse code, it just looks like morse code:

Input Output
Einstein, the father of general relativity. ·−−−− ···−−
Amaterasu, goddess of the sun. ·−−−− −−−−·
Rasputin, the final emperor. ··−−−
Hercules, the son of Zeus. ····−
Pele, the goddess of volcanoes and fire. ·−−−− −−−−−

I've tried to figure out what it is with a test phrase:

Saraswati, the goddess of learning.

Unfortunately, I've had no luck. Can you help me crack it?

##### Hints

My native language is English.
What's the difference?

My test phrase is: विद्या की देवी सरस्वती।
There is one difference between you and me.
There are two differences between banana and kiwi.

The output from your test Phrase "Saraswati, the goddess of learning." is:

·−−−− ··−−

This is because:

The reason it looks like morse code is that it is morse code!

But it's not a direct encoding of the test phrase, it is an encoding of the character count difference between the test phrase and a translation of the test phrase into the native language of the test phrases subject.

Saraswati is a Hindi goddess. The translation provided in your hint is विद्या की देवी सरस्वती। which (including punctuation) is 23 characters. This is a 12 character difference from the 35 character English test phrase, which morse encodes to .---- ..---.

Phrase: Einstein, the father of general relativity.
Language: German
Translation: Einstein, der Vater der Allgemeinen Relativitätstheorie.
Character Difference: 13 (·−−−− ···−−)

Phrase: Amaterasu, goddess of the sun.
Language: Japanese
Translation: 太陽の女神、天照大神。
Character Difference: 19 (·−−−− −−−−·)

Phrase: Rasputin, the final emperor.
Language: Russian
Translation: Распутин, последний император.
Character Difference: 2 (··−−−)

Phrase: Hercules, the son of Zeus.
Language: Greek
Translation: Ηρακλής, γιος του Δία.
Character Difference: 4 (····−)

Phrase: Pele, the goddess of volcanoes and fire.
Language: Hawaiian
Translation: ʻO Pele, ke akua wahine o nā luaipele a me ke ahi.
Character Difference: 10 (·−−−− −−−−−)

The morse code is actually just standard morse code for numbers:

·−−−− ···−− = 1 3
·−−−− −−−−· = 1 9
··−−− =   2
····− =   4
·−−−− −−−−− = 1 0

From the hints we can infer that

we are supposed to translate the given phrases into a language related to the phrase and take the difference of the number of letters between the original and translated phrases.

The first one is easy:

Einstein, the father of general relativity. translates to Einstein, der Vater der Allgemeinen Relativitätstheorie. in German (Einstein was born in Germany). This is an increase of 13 letters, which matches the given number. (Fortunately we didn't encounter the German eszett, ß—would that count as one or two letters?)

We'll skip the second for now and move on to the third one.

Rasputin, the final emperor. translates to Распутин, последний император. in Russian (Rasputin was Russian, although he was a mystic and not an emperor). This is an increase of... 3 letters? But we are supposed to get 2! Well, there are no articles in Russian, so we lost the the, meaning that we have one fewer space, for a net increase of 2 characters. If we are counting characters, maybe we should use the romanization instead, so we can avoid issues with Unicode. Fortunately the romanization Rasputin, posledniy imperator. has exactly the same number of letters/characters.

OK, on to number four.

Hercules, the son of Zeus. translates to Ηρακλής, γιος του Δία. (Iraklís, gios tou Día.) in Greek (Zeus is an ancient Greek deity). This is 4 characters (3 letters) shorter, which matches (if we ignore whether the difference is an increase or decrease). Well, hang on, Zeus is Greek but the subject of the sentence, Hercules, is Latin (he's Heracles in Greek): the sentence translates to Hercules, Jovis filius. in Latin. But this is a loss of 3 characters (1 letter), so Greek seems to be the intended translation.

Number five:

Pele, the goddess of volcanoes and fire. translates to ʻO Pele, ke akua wahine o nā luaipele a me ke ahi. in Hawaiian (Pele is a Hawaiian deity). This is an increase of 10 characters (5 letters), which matches. (Now you may be saying, "hold on just a second, I counted and the translation has only four more letters!" Well, the first letter is actually ʻ: it's not an apostrophe but the letter ʻokina.. In Unicode it's represented by U+02BB MODIFIER LETTER TURNED COMMA, which is in the Lm [Modifier Letter] category and has the Alphabetic property.)

Now let's step back to number two.

Amaterasu, goddess of the sun. translates to 太陽の女神、天照大神。 in Japanese (Amaterasu is a Japanese Shinto deity). Google Translate (which I used for all of the translations) inexplicably gives the romanization Taiyō no megami, tenterudaijin., even though pressing "Listen" pronounces it correctly as Taiyō no megami, Amaterasu Ōkami.. This is an increase of... 3 characters (3 letters)! Well it seems like we are not supposed to use the romanization after all, since the phrase in Japanese has 19 fewer Unicode codepoints (15 fewer letters/characters), which matches. This comparison is a bit apples to oranges, since we are comparing letters and characters (note this is characters in the linguistic sense, not the computer science sense, which is why I earlier specified the difference as a number of Unicode codepoints, to be less ambiguous). In fact, in the case of Japanese we have an additional hiccup since any of the kanji could be written with kana instead (e.g. 太陽 [sun] could be written as たいよう), which would change the number of characters.

Finally, the sentence given in the hint is:

Saraswati, the goddess of learning. in English and विद्या की देवी सरस्वती। (vidya kee devee sarasvatee.) in Hindi (according to Google Translate's "Detect Language" feature). This is a difference of 12 Unicode codepoints, or 18 letters. Note that we again seem to have an off-by-one error in the number of letters: the last character, ।, is a daṇḍa, which marks the end of a sentence like a period. It is represented by U+0964 DEVANAGARI DANDA in the Po (Other Punctuation) category, so it does not have the Alphabetic property.