This is a program for computing multiword anagrams. It makes no effort to come up with sentences that make sense; it only finds anagrammatic sentences, irrespective of meaning.
find_anagrams(sentence)
This will return, and print on the screen, all the anagrams of sentence
By default, select my dictionary of words is English. You can also select the Spanish dictionary.
find_anagrams(sentence ,dict_file='english.txt')
find_anagrams(sentence ,dict_file='spanish.txt')
Or pass your own dictionary. The dictionary format must be a text document with one word per line. An example of a mini-dictionary would be:
dog
home
fun
If there are words that you want to be in your anagram, you include them like this:
find_anagrams(sentence, include=['dog','panda'])
It will only return the anagrams of sentence
that contain the word dog and panda.
If there are words that you dont want to be in your anagram, you exclude them like this:
find_anagrams(sentence, exclude=['cat'])
It will only return the anagrams of sentence
that do not contain the word cat.
If you want to use it more quickly you can simply call it from the console in the following way:
python anagrams.py car has +a -rash -cash
>>> a crash
>>> a chars