Welcome to the Monastery | |
PerlMonks |
Re: literati cheat / finding words from scrambled lettersby PerlingTheUK (Hermit) |
on Nov 20, 2005 at 22:49 UTC ( [id://510304]=note: print w/replies, xml ) | Need Help?? |
In general blochead has probably coded the basics. I understand the actual request is a complete script execution each time reading the dictionary instead of accessing an existing hash, due to server timeout restrictions. If you still cannot afford the cpu time for reading a complete dictionary file, you might want to generate a lookup table to only access the relevant lines in a sorted dictionary file. So if someone looks for "pear*" you only read the lines containing e. g. "ea" anagrams and do not bother reading the whole file. If this is still insuffuciently quick for e. g. two letter lookups, you migh log anagrams that cannot be executed and based on this information extend the lookups for those results returning too many letters. Cheers, PerlingTheUK
In Section
Seekers of Perl Wisdom
|
|