A Scrabble player needs a way to recognize the potential in any collection of tiles. For example, if your rack contains the seven letters AIMNSTU, what eighth letter should you be watching for to create an acceptable eight-letter word? To quickly answer such a question, tournament Scrabble players frequently employ a form of mnemonic1 device called an anamonic. The word is itself a portmanteau2 of anagram and mnemonic, but to explain its exact meaning we need to introduce some other concepts first.

anamonics

In crossword game parlance, a hook is a letter that can be appended or prepended to a word to form another word. For example, the letter S is a hook for the word HOOK because SHOOK is also an existing word. An anahook is a letter that can be added to a word (or more generally any sequence of letters) to make an anagram3 of an existing word. For example, the letter O is an anahook for the word TSUNAMI because the combination of these letters is an anagram of the word MANITOUS. These are the nine anahooks for the word TSUNAMI:

anahooks for TSUNAMI
TSUNAMI + C = TSUNAMIC
TSUNAMI + O = MANITOUS (or TINAMOUS)
TSUNAMI + A = AMIANTUS
TSUNAMI + S = TSUNAMIS
TSUNAMI + T = ANTISMUT
TSUNAMI + L = SIMULANT
TSUNAMI + H = HUMANIST
TSUNAMI + R = NATRIUMS (or NATURISM)
TSUNAMI + M = MANUMITS

To memorize all anahooks of a given word, Scrabble players look for a sentence containing all anahooks (duplicates allowed) but no other letters. The word itself is called the stem and the sentence of anahooks is called the anamonic. A successful anamonic will typically have some memorable semantic relationship to the stem. It will usually avoid unnecessary or easily confused words, which might lead to a misconception of just which letters combine with the stem. For example, we could use the anahooks of the word TSUNAMI to compile the anamonic COASTAL HARM.

Anamonics are interesting because they tell a Scrabble player what letters on the board he can use as an extension for a stem he finds on his rack. Just as importantly, a player can also quickly verify that he should not waste valuable time looking for a word in a set of letters that is ruled out by an anamonic.

Devising useful anamonics has itself become an art form in the Scrabble community. The challenge is to create a memorable phrase using a constrained set of letters. Some of them are really legendary:

stem anamonic
GERMAN LOST TO ALLIES
NATURE VISIT GOD'S SCHOOL
SENIOR OLD MVP JOGS WITH A CRUTCH
WAITER A MAN RAN PANS
LATRINE MOVING FUNNY SPICES
PAINTER GATHERED OILS
READING BED HABITS MOSTLY

Assignment

Write a function anahook that take two strings. Both strings may only contain letters, without the function needing to check this explicitly. If there exists a letter that can be added to the letters in the first string to obtain an anagram of the second string, the function must return that letter (in lowercase). Otherwise the function must return the value None. The function should not make a distinction between uppercase and lowercase.

Use the function anahook to write a class Anamonic that can be used to search for anamonics of a given stem. When instantiating objects of the class Anamonic, the location of a text file must be passed. Each line of that file must contain a word that only contains letters. In addition, the class Anamonic must at least support the following methods:

None of these methods should make a distinction between uppercase and lowercase letters. In determining the anahooks of a given stem, the methods must take the words in the text file passed when instantiating the object as the list of existing words.

Example

In the following interactive session we assume the text file words.txt4 to be located in the current directory.

>>> anahook('tsunami', 'MANITOUS')
'o'
>>> anahook('tsunami', 'humanist')
'h'
>>> anahook('tsunami', 'cartoons')

>>> anamonic = Anamonic('words.txt')
>>> anamonic.anahooks('TSUNAMI') == {'a', 'c', 'h', 'l', 'm', 'o', 'r', 's', 't'}
True
>>> anamonic.anahooks('RETAINS') == {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'k', 'l', 'm', 'n', 'o', 'p', 'r', 's', 't', 'u', 'w'}
True
>>> anamonic.anahooks('INMATE') == {'a', 'b', 'c', 'd', 'e', 'g', 'h', 'i', 'l', 'n', 'o', 'r', 's', 'x', 'y'}
True

>>> anamonic.isAnamonic('TSUNAMI', 'COASTAL HARM')
True
>>> anamonic.isAnamonic('INMATE', 'RELAXING BY HIS CELL DOOR')
True
>>> anamonic.isAnamonic('aurate', 'detect me')
True
>>> anamonic.isAnamonic('PRIEST', 'EVERYONE COMPLAINED OF THE SODOMY')
False
>>> anamonic.isAnamonic('PRIEST', 'EVERYONE COMPLAINED OF YOUTH SODOMY')
True

Epilogue

Jeff Myers wrote in his 2007 article in Word Ways:

One of the first anamonics I ever read, back in 1998, was

PRIEST: EVERYONE COMPLAINED OF THE SODOMY

I couldn't believe it. The letters in that phrase — no more and no less — could combine with PRIEST to make 7-letter words.

When the new Tournament Word List5 was published in 2006, the word PERITUS became a legal word. That's PRIEST + U, so the mnemonic phrase no needed to include a U. One simple fix is:

PRIEST: EVERYONE COMPLAINED OF YOUTH SODOMY

Now maybe even more startling.

John Chew maintains canonical lists of anamonics using the official Tournament Word List6 and the alternate SOWPODS7 word list. Feel free to let him know if you have found an interesting anamonic yourself.

Resources