16
Challenge
Inspired by this video
As you may know, a palindrome is a word that is spelled the same forward as it is backward. The word "PULP" is not a palindrome, but when translated into Morse Code (with the spacing between letters removed), "PULP" becomes ".--...-.-...--." which is a palindrome. Your task is to write a program or function which takes a string and returns whether that word is a palindrome in International Morse Code.
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: --..
Rules
Input
Input can be taken in any reasonable format. The input string will contain only letters in any case you prefer. The string will not contain spaces, numbers, or punctuation.
Output
Your program should output 1 of 2 constant distinct results based on whether the input is a palindrome, e.g. True/False, 1/0, HOTDOG/NOTHOTDOG
Scoring
This is code-golf so shortest answer in bytes wins. Standard loopholes are forbidden.
Test Cases
Input => Output
"PULP" => True
"RESEARCHER" => True
"HOTDOGS" => True
"" => True
"A" => False
"RACECAR" => False
"PROGRAMMING"=> False
"PUZZLES" => False
related – Luis felipe De jesus Munoz – 2018-10-19T18:57:44.240
4Only my vote is a hammer, I'd VTC this as a dupe of the challenge Luis linked; the bulk of most solutions is going to be converting the input to Morse code. – Shaggy – 2018-10-19T19:12:49.960
1It looks like all the solutions are just a Morse code mappings with a "same as reverse" check tacked on, so I'm closing as a duplicate. – xnor – 2018-10-20T04:05:36.520
2It's a shame this is closed as a duplicate, since the duplicate-target has specified (a) that input is from the standard input (disallowing functions) and (b) one must leave non [A-Z]|[A-z]|[0-9] as they are in the input. Together these make some answers here less than trivial to port. – Jonathan Allan – 2018-10-20T13:06:23.113
Oh man - it looks like I hammer open too! I thought I just made a single vote. I've hammered it closed again, but feel maybe it shouldn't be. – Jonathan Allan – 2018-10-20T13:08:42.553
(c) the digits have a pattern to exploit. – Jonathan Allan – 2018-10-20T13:31:32.663
I went ahead and ported my answer here to the target (here). It was not all that trivial, but porting back would be I guess.
– Jonathan Allan – 2018-10-20T14:43:16.767