With a list of letters: 'ABAE?S?' your implementation ran 3.5 times
faster than the one from http://blog.vrplumber.com/427 (in 0.437
seconds vs 1.515)
Without wildcards yours runs slightly quicker as well.
I guess with the wildcards, using an re as a quick filter against each
word, versus the tra
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 increas
Hi Case.
Just in case you're really, truly looking for a fast Scrabble
word-search algorithm, the classic AI/CS article here is:
Andrew W. Appel and Guy J. Jacobson, The world's fastest Scrabble
program, Communications of the ACM, 31(5), pp 572--578, May 1988.
You can find a copy of this article
> "Case" == Case Nelson <[EMAIL PROTECTED]> writes:
> Hi there I've just been playing around with some python code and I've
> got a fun little optimization problem I could use some help with.
> Basically, the program needs to take in a random list of no more than
> 10 letters, and find all p
Mike,
Thanks, this worked great, and was 4x faster than my method!
Thanks everyone for replying!
The changes I made were:
!rest = ''.join([chr(i) for i in range(256) if chr(i).upper() not in
WORD])
!# a wildcard in the word means that we check all letters
!if '?' in WORD:
!rest = ''
!trans
First of all thank you very much for the reply. I hope I'm not too
verbose here, just hope that if someone else runs into a similar
problem they can find an answer here.
> This appears to be a Computer Science 101 Data Structures and
> Algorithms question, not a Python question, but here's an answ
To search for a word which is a jumble of a given set of characters in a
(sizable) lexicon, see this posting:
http://blog.vrplumber.com/427
your alterations would be to check for length == to length -
number-of-wildcards (with the wildcards removed from the translation
table, of course) and
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 char
"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 wor
Case Nelson wrote:
> Hi there I've just been playing around with some python code and I've
> got a fun little optimization problem I could use some help with.
>
> 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
Hi there I've just been playing around with some python code and I've
got a fun little optimization problem I could use some help with.
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).
11 matches
Mail list logo