def build_wordlist(number_of_characters): words = wordlist(WORDLIST) words.filter_n_chars(number_of_characters) return words
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ''' from wordlist import * # set up dictionary # this will only work in Linux # If you're using Windows, you'll need # to source your own word list file # (text file, one word per line, case insensitive) fi=open(r"/usr/share/dict/words","r") w=wordlist(fi) fi.close() # words contain each vowel, but only once for word in w.wordscontainingall("AEiou"): print word print "="*80 # words containing the letter a 3 times and a single b for word in w.wordscontainingall("aAAb"): print word print "="*80 # anagrams of 'team'