'an' - very fast anagram generator

About 'an'

'an' is a very fast anagram generator that can be compiled to run on almost any platform or operating system, including all varieties of Unix, including linux and BSD variants. I am not the original author; however,

Usage

Usage: an [OPTION] PHRASE

  -c, --contain PHRASE  print anagrams containing PHRASE
  -d, --dict DICTIONARY search DICTIONARY for words
  -l, --length WORDS    find anagrams with up to WORDS number of words
  -m, --minimum WORDLEN only use words at least WORDLEN long
  -n, --number NUM      print maximum of NUM anagrams
  -w, --words           print words that PHRASE letters make
  -t, --test ANAG       test whether ANAG can be made with PHRASE
  -u, --used PHRASE     flag PHRASE letters already used
      --help            display this help and exit
      --version         output version information and exit

e.g.

bash-2.05b$ an -c danger 'Ronald Reagan'
danger oral an 
danger anal or
from which we see that /Ronald Reagan/ is /an oral danger/.

Source Code

The 'an' program was originally written by Richard Jones, with contributions by Julian Assange. It, in its Debian package form, is presently maintained by Paul Martin. What you find here is simply the tarball you would obtain if you applied Debian's latest patch to their latest base source tarball.

The copyright is entirely as explained both in the package and on the Debian website. This page exists solely to provide a single tarball from which the package can be built without the need for applying a patch. It was created as follows:

 tar xzvf an_0.95.orig.tar.gz
 zcat an_0.95-2.diff.gz | patch -p0
 tar czvf an_0.95-2.tar.gz an-0.95/

FatPhil's modifications

What I've done is make the program generate an 'alphabet' dynamically, from the input word list. This means that if the locale's alphabet is large but you only use a limited number of letters, then you can still use the program. The way that the build is currently configured, you are limited to 32 different letters. However, a trivial change to the makefile enables that to become 64.

Here are the modified an.c and Makefile files, and precompiled binaries, for windoze, for linux/x86, and binary for Nokia n900 (same source as x86 obviously). Note that the source an.c is identical in the two top packages.

It is assumed that you simply expand those packages on top of the combined Debian package above.

I make, and will make, no claims regarding copyright. My changes are made public freely, but the package itself maintains its prior licence.

AnAffront! - 'an' front end (graphical) for Unix-alikes

Note: As of 2011-11-11, AnAffront is in the public domain. It needs work, I don't have time to do that myself, so please, just slap it into some shape and distribute freely. I would like to be notified of your improvements if you make any.

anaffront.pl requires the Tk libraries for perl, but those are pretty standard on all platforms that run X.

It's not 100% intuitive, alas, but here's a quick intro. Note - you must either edit the script (ain't open source wunnerful!) to point to the correct dictionary you want to use, or configure the dictionary every time you use the program.

Phrase
Stick the phrase you want to anagram here
Words
Stick any words that you want to be in the 'gram here.
delete
Deletes the rightmost word from the 'words' box.
Get Words
Finds words possible using the remaining letters (= 'phrase' - 'words'). The list of words so generated will not automatically change when you alter the source phrase or the wanted words; you need to click this button again.
Filter
After getting words, you can stick letters in the filter box, and clicking filter will restrict the list of words shown to those containing all of those letters. It does not regenerate the list of words.
the list of words
Double clicking on a word here will place it into the 'Words' field.
Configuration
Use this to select what dictionary to use, and the minimum length of words that you want the word list to contain.
Get Anagrams
Use this to get a list of all anagrams that are available from the source phrase that contain all the words requested. This list is limited to 100000 entries.
the anagrams list
Double clicking here will output the anagram to stdout (the console window which it was launched from).

It was my first ever Perl/Tk program, so is far from elegant!

Anna says: Using anaffront by Phil = turn off playing in bash


Another hastily constructed page by Phil Carmody
Home / Words / an.html