replace only full words

2013-09-28 Thread cerr
Hi, I have a list of sentences and a list of words. Every full word that appears within sentence shall be extended by WORD i.e. I drink in the house. Would become I drink in the house. (and not I drink in the house.)I have attempted it like this: for sentence in sentences: for noun in

Re: replace only full words

2013-09-28 Thread Tim Chase
On 2013-09-28 09:11, cerr wrote: I have a list of sentences and a list of words. Every full word that appears within sentence shall be extended by WORD i.e. I drink in the house. Would become I drink in the house. (and not I drink in the house.) This is a good place to reach for regular

Re: replace only full words

2013-09-28 Thread MRAB
On 28/09/2013 17:11, cerr wrote: Hi, I have a list of sentences and a list of words. Every full word that appears within sentence shall be extended by WORD i.e. I drink in the house. Would become I drink in the house. (and not I drink in the house.)I have attempted it like this: for

Re: replace only full words

2013-09-28 Thread Jussi Piitulainen
MRAB writes: On 28/09/2013 17:11, cerr wrote: Hi, I have a list of sentences and a list of words. Every full word that appears within sentence shall be extended by WORD i.e. I drink in the house. Would become I drink in the house. (and not I drink in the house.)I have attempted it

Re: replace only full words

2013-09-28 Thread cerr
On Saturday, September 28, 2013 4:54:35 PM UTC, Tim Chase wrote: On 2013-09-28 09:11, cerr wrote: I have a list of sentences and a list of words. Every full word that appears within sentence shall be extended by WORD i.e. I drink in the house. Would become I drink in the house. (and

Re: replace only full words

2013-09-28 Thread MRAB
On 28/09/2013 18:43, cerr wrote: [snip] Great, only I don't have the re module on my system :( Really? It's part of Python's standard distribution. -- https://mail.python.org/mailman/listinfo/python-list

Re: replace only full words

2013-09-28 Thread Tim Chase
[mercy, you could have trimmed down that reply] On 2013-09-28 10:43, cerr wrote: On Saturday, September 28, 2013 4:54:35 PM UTC, Tim Chase wrote: import re Great, only I don't have the re module on my system :( Um, it's a standard Python library. You sure about that?

Re: replace only full words

2013-09-28 Thread cerr
On Saturday, September 28, 2013 11:07:11 AM UTC-7, MRAB wrote: On 28/09/2013 18:43, cerr wrote: [snip] Great, only I don't have the re module on my system :( Really? It's part of Python's standard distribution. Oh no, sorry, mis-nformation, i DO have module re available!!! All

Re: replace only full words

2013-09-28 Thread cerr
On Saturday, September 28, 2013 11:17:19 AM UTC-7, Tim Chase wrote: [mercy, you could have trimmed down that reply] On 2013-09-28 10:43, cerr wrote: On Saturday, September 28, 2013 4:54:35 PM UTC, Tim Chase wrote: import re Great, only I don't have the re module on my