Re: [Tutor] A string-manipulation question

2007-04-02 Thread HouseScript
>>The only "hitch" I see is how one tells that an initial >>consonant is a vowel sound or not. (honor vs home)? The above is exactly what I was thinking about, theres no way I could think of besides creating a dict for the few thousand English words that have this trait. Then run a search agai

Re: [Tutor] A string-manipulation question

2007-03-30 Thread Bob Gailer
[EMAIL PROTECTED] wrote: > Alan Gilfoy wrote: > > > Is there a way in Python to separate a string into its component words. > you could do something like this: > >>> x = Is there a way in Python to seperate a string into its > compontent words. > >>> x.split() > that would yield: > ['Is', 'there',

Re: [Tutor] A string-manipulation question

2007-03-30 Thread HouseScript
Alan Gilfoy wrote: > Is there a way in Python to separate a string into its component words. you could do something like this: >>> x = Is there a way in Python to seperate a string into its compontent words. >>> x.split() that would yield: ['Is', 'there', 'a', 'way', 'in', 'Python', 'to', 'se

Re: [Tutor] A string-manipulation question

2007-03-30 Thread Kent Johnson
Alan Gilfoy wrote: > Awesome! (I was hoping it would be a 1-line solution. :) > Thanks to batteries beign included, I don't necessarily need to worry > about why and how .spilt() works. :) You might want to look at the docs for split() so you can use it again next time you have a need. http://d

Re: [Tutor] A string-manipulation question

2007-03-29 Thread Alan Gilfoy
Awesome! (I was hoping it would be a 1-line solution. :) Thanks to batteries beign included, I don't necessarily need to worry about why and how .spilt() works. :) Quoting Bob Gailer <[EMAIL PROTECTED]>: > Alan Gilfoy wrote: >> Hi. I want to learn how to "break down" a string into its component

Re: [Tutor] A string-manipulation question

2007-03-29 Thread R. Alan Monroe
> Hi. I want to learn how to "break down" a string into its component > words, and then process each word somehow. > Is there a way in Python to separate a string into its component words. > Like this: > "I would like to convert an English string (sentence) into Pig Latin." for word in sentenc

Re: [Tutor] A string-manipulation question

2007-03-29 Thread Bob Gailer
Alan Gilfoy wrote: > Hi. I want to learn how to "break down" a string into its component > words, and then process each word somehow. > > Is there a way in Python to separate a string into its component words. > > Like this: > "I would like to convert an English string (sentence) into Pig Latin."

[Tutor] A string-manipulation question

2007-03-29 Thread Alan Gilfoy
Hi. I want to learn how to "break down" a string into its component words, and then process each word somehow. Is there a way in Python to separate a string into its component words. Like this: "I would like to convert an English string (sentence) into Pig Latin." The Pig Latin conversion I th