A scale of palindromes

Ole
5 min readJan 4, 2024

--

Photo by Piotr Łaskawski on Unsplash

Many people know what a palindrome is, but let me tell you, anyway.

Palindromes are words like Eve or phrases like Never odd or even or even whole sentences like Was it a car or a cat I saw? that when written back to front give you just again the same word, phrase, or sentence.

Or at least that is its original meaning; for the word is nowadays not only used for words, but for basically any string of symbols like numbers (3141551413), morse code (,,, --- ,,,), DNA sequences (although DNA palindromes depend on the complementary bases (if you have any idea what I'm talking about)) or structural formulas of molecules (H-O-H (H2O)) and music notation.

And there are technically even palindrome poems, but most of them (but not all) are just palindromes by word, not by letter. So, they might write Hello Word, Hello that when reversed by letter gives you olleh drow olleh, but when you just reverse the word order it obviously gives Hello World Hello. I do admit that those kinds of palindromes exist, I just don't care that they do, and I think you should do the same.

The best palindrome poem I have found yet that is actually a palindrome by letter is the 222-word-poem Dammit I'm mad by Demetri Martin. (Or maybe it's even longer, if you count abbreviations like I'm as two words, but in this case I prefer counting them as one word, as this makes the word count a palindrome as well)

I hope you now see that palindromes are wonderful…
But they aren't equally wonderful, so the logical thing to do know is to invent a way to measure the wonderfulness of a palindrome.

The way I see it, there are only 3 indicators to measure a palindrome's greatness:

The Length: I mean, checking if something is a palindrome only gets funnier the longer the thing is. Thus, Otto should get fewer points than Mr. Alarm, who gets less points for length than Dammit I'm mad.

The Letter Diversity: The problem gets really obvious when we take this scream as an example: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa! This thing is technically a palindrome, a palindrome with a pretty high length score even, but not really a creative one.

The Type: Palindrome types are ~probably~ (I've stumbled on much more palindrome content than I would have ever imagined. I wouldn't be that surprised, if it turns out somebody did that before.) something I invented, although I used blood types as reference point. So my idea is that there are 4 palindrome types:

Zero: Just a regular palindrome where you don't have to fumble around with any spaces or punctuation when reversed (A man, a plan, a canal - Panama, when really reversed gives you Amanap -lanac a, nalp a, nam a). So one word palindromes like racecar (when written as one word), but also specific palindromes like Rats live on no evil star or No devil lived on where no fumbling with neither punctuation nor with spaces is needed fall in Palindrome Type 0.

A: Type A Palindromes are those palindromes where you'll need to fumble around with spaces like in A Toyota in order to make it fit, but not with any kind of punctuation.

B: Palindromes of Type B are those palindromes that require no fumbling with the spaces in between words, but do need you to skip the punctuation in order to really be a palindrome. But I have decided that those sentence-palindromes that only have one punctuation mark ('.?!;') at the end should rather be Type 0 palindromes.

AB: You probably already suspected that Palindrome Type AB includes all palindromes that will need you to fumble with the spaces as well as with the punctuation.

So with the criteria decided upon, it's time to do some calculations. But I'm honest can't really decide what the types are supposed to mean. Is a type 0 palindrome better or worse than an AB-palindrome. I don't know. I previously thought that type 0 palindromes are obviously the best, as they are so clean, but now I see some kind of weird beauty in those other types. So, again: I don't know.

Oh, and about not knowing: Is something short really worse than something long? Is something short not just more compact and straight-to-the-point?

What I'm saying is palindromes can't really be judged objectively as they are art and art can't be judged objectively. I mean, sure you can look at a painting and say that the perspective is wrong. But is it really wrong, or just not ordinary?

So, maybe all palindromes are equally wonderful…

But it still took me a moment to realize this, so I already wrote some python code to check, if a string is a palindrome. And out of frustration that emerged while doing this did the whole type idea arise.

As I didn't want the code to have no use at all, is here the code to categorize all your random csv-files by type.

import csv
PUNCTUATION = '''“”:,.!?`'&"-’();'''

def removeSpaces(string: str):
return string.replace(" ", "")

def removePunctuation(string: str):
for char in PUNCTUATION:
string = string.replace(char, "")
return string

def isPalindrome(string: str):
string = string.upper()
charsLeftToRight = list(string)
charsRightToLeft = charsLeftToRight.copy()
charsRightToLeft.reverse()
if charsLeftToRight == charsRightToLeft:
return True
else:
return False

def isPalindromeWithoutPunctuation(string: str):
return isPalindrome(removePunctuation(string))

def isPalindromeWithoutSpaces(string: str):
return isPalindrome(removeSpaces(string))

def isPalindromeWithoutSpacesAndPunctuation(string: str):
string = removeSpaces(string)
string = removePunctuation(string)
return isPalindrome(string)

if __name__ == '__main__':
with open('palindrome\list.csv', newline='') as csvfile:
test = csv.reader(csvfile, delimiter=' ', quotechar='|')
for row in test:
string = ' '.join(row)
print(string)
if isPalindrome(string):
print("Type 0")
elif isPalindromeWithoutSpaces(string):
print("Type A")
elif isPalindromeWithoutPunctuation(string):
print("Type B")
elif isPalindromeWithoutSpacesAndPunctuation(string):
print("Type AB")
else:
print("Not a palindrome")
print("")

Ey, …

Bye

P.S.: What I didn’t mention are phonetic palindromes. They have basically no connection with the real topic of this text, but I’ve also introduced you to the existence of DNA palindromes, and they do neither, so:
They are words that when said, recorded and reversed sound virtually identical to before.

P.P.S.: Cartoonist Jon Agee actually wrote an entire comic or a palindrama how he calls it, just with palindromes. It’s named Otto, written and illustrated by like I said Jon Agee who actually placed third in the first World Palindrome Championship.

P.P.P.S.: And do you know who won the first World Palindrome Champion? Mark Saltveit who is also the publisher of the magazine The Palindromist.

Doesn’t all of this show you again that every topic, however obscure, has its own little world attached to it?

--

--