Author: Joel Burton

# Anagrammer

Author: | Joel Burton
Version: | 1.0
License: | GPL 2.0 or newer
Summary: | Anagram-finder using dictionaries

This program will help you generate anagrams for playing word games.

For example, if you run it like:

    $ anagrammer mushroom

it returns:

    mushroom

    8 = 1
      mushroom
    6 = 3
      hommos humors mohurs
    5 = 6
      homos hours humor mohur moors rooms

Which are all of the anagrams of mushroom in the dictionary over 5 characters long.

You can specify command-line options for the minimum number of letters, or to use alternate dictionaries. In addition, you can capitalize letters, and these letters will be required in the resulting words. For example, if we had typed "MusHroom", above, our 5-letter words would be: "homos humor mohur", since these these use both M and H.

There is also a command-line switch (-c) to produce "single-column" mode, rather than nicely printing results, as shown above. For our same query, this would return:

    mushroom
    humors
    mohurs
    hommos
    humor
    mohur
    homos
    moors
    rooms
    hours

This output is useful for feeding to other programs/filters.

# Dictionaries

Anagrammer does not come with any real dictionaries; instead, you must create these.

In order to find anagrams efficiently, it must precompute an anagram dictionary from a list of words. You can do this as:

    $ anagrammer --create /path/to/list/of/words/foo

Which creates foo.anagram, stored in /usr/local/share/games/anagrammer. You can change the dictionary path by editing the config.py.

A suitable dictionary to use would be the one that ships with most Linux/Unix systems, usually found at /usr/share/dict/words. An excellent set of much more comprehensive dictionaries are at http://personal.riverusers.com/~thegrendel/software.html

If you cannot find a dictionary, or just want to play with anagrammer, a play dictionary is included, "mini.lst.gz". This contains words starting with a, b, or c, that are 3-7 characters long. You can convert it with:

    $ anagrammer --create mini.gz

Which will create a dictionary called "mini" in the above directory.