That was pretty good for a one-word anagram. Back in the 1990s I wrote a program that generated anagrams for longer phrases and I was surprised to find these prescient ones:
Saddam Hussein = He damns Saudis
Charles Manson = Slasher con man
David Letterman = Dead mitral vent
Mary Jo Kopechne = My joke chaperon *
Benito Mussolini = So, I bout Leninism
Lee Harvey Oswald = Oe, why ever Dallas? *
* "Chaperon" is a valid alternate spelling of "chaperone"
> I guess I’ll be known for nothing more than being the man who realized that “Spiro Agnew” was “grow a penis.” Gore Vidal said, “It could be ‘grow a spine,’ too, but yours is better.”
Boy, they're really socking it to that Spiro Agnew guy again.
Things like that explain how some people get obsessed with numerology. Except, I find the anagrams like you and the previous commenter mentioned to be more impressive than anything numerologists produce.
Some of those are almost creepy in how they make so much sense.
We're pattern matching machines, if you throw enough randomness at us we will find patterns anyway.
Probably because looking at evolution it's more helpful to see a predator that isn't there, than to miss a predator that is there. It intuitively makes sense that we would tilt towards false positives over false negatives in our perception. Since one has a higher cost attached than the other.
Which is why I find some of the discussion arround whether GPTs are intelligent interesting. I see the argument quite often that they merely match patterns and combine things. Which to me seems very much akin to us. They lack the ability to interact with the world and there is no feedback loop as of now, but it seems to me that there is something very human to the AI we programmed.
Ted Kennedy, her "chaperon," was male, so it works perfectly. Although I don't think the difference between the spellings is a gender thing, but rather a British/American thing.
How many generated anagrams do you have to skim through to find these gems? Was the program written in a way that limits the output to phrases that make at least some sense?
It had features for things like limiting output to anagrams that contain a maximum number of words, or words with a minimum length, so you wouldn't have to slog through every permutation. Usually the most interesting ones had the fewest words. But "interesting" is subjective so if you really wanted to find juicy ones you would have to spend more time combing through the results by hand.
The most remarkable name anagram for me remains that of 1990s UK conservative Health Secretary and government minister Virginia Bottomley (now Baroness Bottomley of Nettlestone), whose name rearranges to “I’m an evil Tory bigot”.
In terms of this ‘chunk scoring’ method this scores very high (15 I think?), which definitely confirms its value as a way of rating anagram quality.
It just searched Bing and loaded up this very article. And man I'm getting really sick of the unrelated ChatGPT comments on literally every post, no offense.
Actually early genx. I don’t think most millennials were old enough for a lot of the jokes in 90’s simpsons as they were young teens. But glad you got it!
What’s nostalgic to me is that this is such a classic Perl pattern: hashing manipulated strings to find relationships. Prior to Perl doing this was painful. Boost wasn’t a thing. Python was in its cradle and Java was still struggling with beans. Perl removed the barriers between complex coding ideas and an implementation that C wasn’t ready for. The time from thought to prototype was near instant compared to current compiled languages.
Ummm, the author used awk for the first version in the 1990s.
> This was easy to do, even at the time, when the word list itself, at 2.5 megabytes, was a file of significant size. Perl and its cousins were not yet common; in those days I used Awk. But the task is not very different in any reasonable language:
As a concrete example, while my awk skills are extremely rusty, here's a program which will normalize the input line, create a table mapping the normalized name to the matching original lines, then at the end it only displays the ones with at least 5 anagrams.
I tried to avoid modern awk features, like asort, to be something that would have worked in the 1980s:
{
# Convert to normal form:
# 1. Fold to lower case
# 2. Bin the letters to get frequency counts
# 3. Only consider lower case ASCII letters
split(tolower($0), letters, "");
# Ignore asort() in modern awks and do a bin sort instead.
for (i in letters) {
c = letters[i];
repeats[c] = repeats[c] c;
}
normal_form = "";
for (i=97; i<=122; i++) {
c = sprintf("%c", i); # no chr() in a 1980s awk
normal_form = normal_form repeats[c];
}
table[normal_form] = table[normal_form] "," $0
delete repeats;
}
END {
# Only show the ones with at least 5 matches
for (i in table) {
match_str = table[i];
split(match_str, matches, ",");
num_matches = length(matches)-1
if (num_matches >= 5) {
# print the number of matches, then the match string
printf("%d%s\n", num_matches, match_str);
}
}
}
When I try it on a word list I have handy, here are the most common words:
Certainly Perl is more succinct, though note that even up to Perl 4 in the early 1990s you would need to use the string concatenation method to store the list of matches in the table.
But, "painful"? No. Not to someone who knew how to use awk.
The point is that you don’t need a hash table implementation. And the normalization that is used as the sorting key doesn’t otherwise have good hash-like qualities (like constant size and a good distribution) and thus doesn’t especially deserve to be called a hash.
It can be a simple ~20 line C program that checks whether the previous line has the same normalized key as the current line. It doesn't require hashing. I didn't say you could do it all with standard unix programs.
You pipe the sorted list into awk (for example) and append the second field to a list as long as the value of the first field remains the same. Whenever the value of the first field changes, and in the END block, you output the list (which contains the matching anagrams) and reset it to empty.
No hash table needed, just splitting the line into the two fields, equality comparison, and appending values to a list.
Go try your method and spot the bug. If you can’t, then respond and I’ll tell you. hint: you need one more manipulation to find the answer before or after the sort, there’s a command line version of it but it uses .. a hash.
I thought integrals / triangles was much more interesting, despite the shorter length. None of the other long pairs have any meaningful relationship, except for maybe excitation / intoxicate
That one has real meaning too. Being naturally inclined to mentally run through all the worst case scenarios for everything has definitely saved me time over the years.
I think the best anagrams are the ones that create meaningful phases, I would probably train a SVM or a simple linear layer on BERT (or other encoder) embeddings and use it to score the results.
imo interpretation of actually as "I can't believe someone did this (that someone could be so stupid)" rather than actually as "this is an event that definitely occured". Didn't seem too bad to me.
You basically said, “Can you believe someone actually was so stupid as to ask this question on stackexchange? I didn’t believe anyone could actually be that stupid, so I wasn’t go to address it, but it turns out there actually are people that stupid, and they actually outed themselves by posting their question out in the open! So, here I am having to address it in my blog post in case there are other people who actually are equally stupid.”
I’m pretty sure I wrote an anagram solver as a teenager that just spins through permutations forever. I guess I was that stupid once. No comment on whether I’m cured now. Your point is valid, the wording can be read as to imply negativity, but that’s also interpreting it in a negative light. The author was also defending his warning against an imaginary rebuttal, justifying the mention to not to waste time solving anagrams the naive brute force way. I don’t think he was trying to be elitist or offensive, and it is in fact true that people will solve anagrams the slow way, so doesn’t hurt to mention it, and it can even help on occasion. We don’t have to take it as condescending.
I didn't “basically” say any of that. I didn't say any of it at all; you made it all up and then attributed it to me. All I actually did was to state a fact: someone on StackExchange actually asked this question.
All those thoughts about what a stupid question it is, and how stupid someone must have been to ask it—all those are thoughts you had, not me.
FWIW, I also originally read that line to imply "I thought this was obvious, but apparently I need to be explicit anyway".
Given the tone of the rest of the article I assumed that I'd either read something into it that wasn't there or was missing some context - for example, perhaps the person on SO had insisted that this was the correct approach, and you'd gone to some lengths to show that it was not and were exasperated by it by the time you wrote the article.
At any rate - it didn't really take away from your article for me, but I did see it as condescending.
While I personally agree with the end result - cinematographer megachiropteran possibly being the best anagram, its worth exploring other scoring mechanisms I suppose - some kind of alliteration / cadence score to quantify how the words roll in succession. Maybe throw in semantic distance as well using clip embeddings probably to quantify the surprise element (or closeness for that matter). Gonna play around with this and see what I can do.
Similar to this, he produces a standard form for each word, but breaks each letter into letter pieces or 'atoms' which gives much more freedom for moving between words.
Definitely give it a watch. If you are not familiar with Tom7's videos, he has a hilarious whimsical style while also bringing to life completely out there ideas with some brilliant technical skill.
Megachiropterans are fruit bats. They are really stinking adorable, especially when compared to smaller insect-eating bats, and for that reason are sometimes called flying foxes. In short, they make good subjects for cinematographers.
One of the longest anagrams I know that doesn't involve obscure medical words is "astronomers" and "moon starers." Both of these phrases contain the same letters but in a different order, making them anagrams of each other. This anagram contains 11 letters and is quite interesting, as both phrases relate to looking up at the night sky and studying celestial bodies.
Given that he added that middle "initial" himself and he didn't actually have a middle name, I like thinking that he added it precisely to make that joke work. Probably not true, but I still like it.
I wonder whether someone made a similar effort for finding the "most rhyming" words in English. Of course, since this would be based on sound, it would need to incorporate additional information besides spelling.
It also starts a huge argument about what kinds of rhyming are permitted (visual, sound, which accent, etc) - and some languages “rhyme” on things we wouldn’t use in English like the emphasis, etc.
235 comments
[ 5.0 ms ] story [ 73.5 ms ] threadRewrite all words so the letters in each word are rearranged alphabetically. Don't do this other thing suggested on StackExchange
Look at the list of anagrams
Recognize that the list is actually boring
Get silly with words and nerd out
The end!
http://archive.today/vyp1c
Eyeballed the entire list*. This is the most 2023 one I could find.
(*no)
Saddam Hussein = He damns Saudis
Charles Manson = Slasher con man
David Letterman = Dead mitral vent
Mary Jo Kopechne = My joke chaperon *
Benito Mussolini = So, I bout Leninism
Lee Harvey Oswald = Oe, why ever Dallas? *
* "Chaperon" is a valid alternate spelling of "chaperone"
** Yes, "oe" is a word
> I guess I’ll be known for nothing more than being the man who realized that “Spiro Agnew” was “grow a penis.” Gore Vidal said, “It could be ‘grow a spine,’ too, but yours is better.”
Boy, they're really socking it to that Spiro Agnew guy again.
I also like the mathematically correct
ELEVEN PLUS TWO = TWELVE PLUS ONE
especially because it's also an numeric anagram
11 + 2 = 12 + 1
Goedel's incompleteness theorem fans would be drooling all over this
Some of those are almost creepy in how they make so much sense.
Probably because looking at evolution it's more helpful to see a predator that isn't there, than to miss a predator that is there. It intuitively makes sense that we would tilt towards false positives over false negatives in our perception. Since one has a higher cost attached than the other.
Which is why I find some of the discussion arround whether GPTs are intelligent interesting. I see the argument quite often that they merely match patterns and combine things. Which to me seems very much akin to us. They lack the ability to interact with the world and there is no feedback loop as of now, but it seems to me that there is something very human to the AI we programmed.
Atlantic casino resort spa / Carter assassination plot
You can find the documentation, a Win32 executable, and the source code here: https://www.kmoser.com/anagrams/
In terms of this ‘chunk scoring’ method this scores very high (15 I think?), which definitely confirms its value as a way of rating anagram quality.
I was born in 1982, and a lot of the humor went over my head til much later. But the first ten seasons or so are still indelibly etched in my memory.
> This was easy to do, even at the time, when the word list itself, at 2.5 megabytes, was a file of significant size. Perl and its cousins were not yet common; in those days I used Awk. But the task is not very different in any reasonable language:
You wrote "Prior to Perl doing this was painful.".
I highlighted how you contradicted the author's claim that it was easy to do using awk. Awk existed long before Perl.
I tried to avoid modern awk features, like asort, to be something that would have worked in the 1980s:
When I try it on a word list I have handy, here are the most common words: Certainly Perl is more succinct, though note that even up to Perl 4 in the early 1990s you would need to use the string concatenation method to store the list of matches in the table.But, "painful"? No. Not to someone who knew how to use awk.
The simplest way to do it, is to convert all the words to (normal_form, orig_word) pairs, write the list to a file, then sort it.
It will be trivial to find the words with common normal form after the sort.
(Of course, you wouldn't catch me trying to implement that with C if perl is an option...)
No hash table needed, just splitting the line into the two fields, equality comparison, and appending values to a list.
> 7 admirer married > 7 admires sidearm
cholecystoduodenostomy / duodenocholecystostomy
https://gist.github.com/anonymous/431b163b2a2d532bfd0a3bdcc7...
See https://blog.plover.com/lang/anagram-scoring-3.html for more details.
misrelation / orientalism; superintended / unpredestined; incorporate / procreation (don't mind if i do!); predators / teardrops (a cause and effect); counteridea / reeducation (a bit synonymous); streamlined / derailments (quite opposite!); truculent / unclutter; colonialist / oscillation; renavigate / vegetarian; persistent / prettiness; paternoster / penetrators (hmm); obscurantist / subtractions; nectarines / transience (a story of ripeness); definability / identifiably; indiscreet / iridescent; excitation / intoxicate; discounter / reductions (how logical!)
One small suggestion I have: add a point for pairs with different starting letters, and another point for pairs with different ending letters.
I wonder if the author realizes how condescending this is.
All those thoughts about what a stupid question it is, and how stupid someone must have been to ask it—all those are thoughts you had, not me.
Given the tone of the rest of the article I assumed that I'd either read something into it that wasn't there or was missing some context - for example, perhaps the person on SO had insisted that this was the correct approach, and you'd gone to some lengths to show that it was not and were exasperated by it by the time you wrote the article.
At any rate - it didn't really take away from your article for me, but I did see it as condescending.
Similar to this, he produces a standard form for each word, but breaks each letter into letter pieces or 'atoms' which gives much more freedom for moving between words.
Definitely give it a watch. If you are not familiar with Tom7's videos, he has a hilarious whimsical style while also bringing to life completely out there ideas with some brilliant technical skill.
ChatGPT
astronomers = moon starers = no more stars
Now that's something...
https://news.ycombinator.com/item?id=13696196
Response by the author:
https://blog.plover.com/lang/anagram-scoring-3.html
> Productive diminutives are infrequent to nonexistent in Standard English in comparison with many other languages.
https://en.m.wikipedia.org/wiki/List_of_diminutives_by_langu...
https://www.nytimes.com/puzzles/spelling-bee