To use:
try    #Makes program and dictionary, then executes with sample data

calc 10 123 x 456 file  #Multiply 123 by 456, save pattern to file
matchwrd dict file      #Find a match for the multiplication
Format:
organize
No arguments, works stdin -> stdout
Sorts a dictionary given with each word on a separate line into the format expected by the main program

calc <base> <arg1> <op> <arg2> <save file>
Performs a calculation and writes the resulting pattern to a file
base = what base to use, usually 10 (decimal)
op = the operation to apply, + for addition or x for multiplication
arg1, arg2 = the arguments to apply the operation to. After 0 to 9, uses a to z. Not case sensitive
save file = the name of the file to save the result to

matchwrd <dictionary> <pattern>
Matches a pattern to the dictionary
dictionary = the preprocessed dictionary from organize
pattern = the calculated pattern from calc

Technical:
The input dictionary is in the form of 1 word per line. organize takes that and sorts it in 3 ways: length, number of unique characters, and alphabetic. This is accomplished using QuickSort. The input patterns already have known lengths, and a known number of unique characters. This allows the program to go straight to the relevant section. matchwrd preprocesses the list and generates the data for how far ahead to skip to go to the next letter in a given position in a word. This makes the search faster by a constant.

The search is a simple DFS. It starts with the first pattern in the group and goes through possible assignments that fit the pattern. When one fits, it recursively tries the next pattern in the group, until there are no patterns left. If it reaches the bottom, that means that it is a match, which is then returned. If the first pattern in the group has no match, that means that no match exists, so that is what it returns.

Downloads:
Alphametics-standalone C++ source code of the alphametics generator. Includes words file to be converted into a dictionary.
Alphametics-CGI C++ source code of the CGI version of the alphametics generator. Get this if you want to add it to your webpage. Does not include the dictionary file. This version can be tried here.
Dictionary The dictionary file to be used with either of the above programs.