On Tue, Oct 7, 2008 at 5:58 PM, Emile van Sebille <[EMAIL PROTECTED]> wrote:
> Robert Berman wrote:
>
>> Hi,
>>
>> The below script which prints anagrams available for any word available
>> within a given database. It does work, but it is not very fast. I am
>> relatively certain there are more P
Robert Berman wrote:
Hi,
The below script which prints anagrams available for any word available
within a given database. It does work, but it is not very fast. I am
relatively certain there are more Python friendly coding techniques but
I am more concerned with a faster algorithm.
You mig
Yet another approach to experiment with. Thank you all
very much,
Robert
Kent Johnson wrote:
On Tue, Oct 7, 2008 at 1:15 PM, Richard Lovely
<[EMAIL PROTECTED]> wrote:
In a slightly related matter, Is is possible to use all() with a list
comprehension to check if a word contains a
On Tue, Oct 7, 2008 at 1:15 PM, Richard Lovely
<[EMAIL PROTECTED]> wrote:
> In a slightly related matter, Is is possible to use all() with a list
> comprehension to check if a word contains all of the letters of
> another?
Sure.
In [1]: all(letter in 'abcde' for letter in 'cde')
Out[1]: True
In
In a slightly related matter, Is is possible to use all() with a list
comprehension to check if a word contains all of the letters of
another?
--
Richard "Roadie Rich" Lovely, part of the JNP|UK Famile
www.theJNP.com
___
Tutor maillist - Tutor@python.
Kent,
Thank you for two excellent suggestions. I will implement yourÂ
suggestion of indexing by the sorted letters in the word.
Robert
Kent Johnson wrote:
On Sun, Oct 5, 2008 at 1:52 PM, Robert Berman <[EMAIL PROTECTED]> wrote:
The database item consists of the key; the actual
On Sun, Oct 5, 2008 at 1:52 PM, Robert Berman <[EMAIL PROTECTED]> wrote:
> The database item consists of the key; the actual word, and the value, the
> size as a string. For example, the word 'myth' is represented as key=
> 'myth', value = '4'. I think the slow part of the algorithm is the script
Hi,
The below script which prints anagrams available for any word available
within a given database. It does work, but it is not very fast. I am
relatively certain there are more Python friendly coding techniques but
I am more concerned with a faster algorithm.
The database item consists of