[Tutor] word challenge

gyro funch gyromagnetic@excite.com
Fri Jul 18 14:38:05 2003


Hi,
I thought that this might be an interesting challenge for those of you with a 'puzzling' disposition. ;-)

Suppose I have a phrase from which I want to extract a word made up of at least one letter from each of the words (more than one letter may be taken from each word if desired). The letters must be aligned in the order in which they were taken from the words. 

For instance, if I have the phrase: "handy cool phrase"
I might extract the "h" from "handy", one "o" from "cool", and the "r","s",and "e" from "phrase" to give "horse".  

Each word must exist in some defined dictionary or word list.

I'm looking for an efficient (and/or clever) implementation in Python of some algorithm satisfying these requirements.

I am coding my own solution, but I am interested in what other people come up with as well.

Thanks and have fun.

-g




_______________________________________________
Join Excite! - http://www.excite.com
The most personalized portal on the Web!