Faster way to do this?
John Wilson
tug at wilson.co.uk
Wed May 21 18:05:53 EDT 2003
----- Original Message -----
From: "Lulu of the Lotus-Eaters" <mertz at gnosis.cx>
Newsgroups: comp.lang.python
To: "Pythonistas" <python-list at python.org>
Sent: Wednesday, May 21, 2003 6:30 PM
Subject: Re: Faster way to do this?
[snip]
> I wrote my own version of the script:
>
> % python wordfind-re.py olhel
> Read words in 0.02s
> ['eel', 'el', 'he', 'heel', 'hell', 'hello', 'hoe', 'hole', 'lee',
'oh']
> Method RE: found 10 words in 0.06s
>
> I think you could call this an improvement :-). The script:
I think that there's a problem with the regexp.
With the augment "ead" I get matches ['ad', 'Ada', 'add', 'added', 'dad',
'Dada', 'Dade', 'De', 'dead', 'Dee', 'deed', 'deeded', 'Ed']
Looks like a single letter matches multiple times.
John Wilson
The Wilson Partnership
http://www.wilson.co.uk
More information about the Python-list
mailing list