how to remove the punctuation and no need words from paragraphs

Chris Rebert clp2 at rebertia.com
Wed Nov 4 02:42:01 EST 2009


On Tue, Nov 3, 2009 at 1:44 PM, kylin <huili.song at gmail.com> wrote:
> I want to remove all the punctuation and no need words form a string
> datasets for experiment.
>
> I am new to python, please give me some clue and direction to write
> this code.

The `replace` method of strings should get you pretty far (just
replace unwanted stuff with the empty string):
http://docs.python.org/library/stdtypes.html#str.replace

Cheers,
Chris
--
http://blog.rebertia.com



More information about the Python-list mailing list