Paul Rubin wrote: > "Case Nelson" <[EMAIL PROTECTED]> writes: > > Basically, the program needs to take in a random list of no more than > > 10 letters, and find all possible mutations that match a word in my > > dictionary (80k words). However a wildcard letter '?' is also an > > acceptable character which increases the worst case time significantly. > > For that size pattern and dictionary, simply compiling the pattern to > a regexp, joining the dictionary together into one big string ("abc > def ghijk..."), and matching the regexp against the big string, may > well be faster than using some fancy algorithm coded completely in > python.
Paul, given the OP appears to want something like words that match any (per)mutation of any substring of his query string -- and that's before factoring in wildcards -- I'd like to see an example of a regexp that could handle that. Cheers, John -- http://mail.python.org/mailman/listinfo/python-list