Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Python (http://www.velocityreviews.com/forums/f43-python.html)
-   -   how to remove the punctuation and no need words from paragraphs (http://www.velocityreviews.com/forums/t704088-how-to-remove-the-punctuation-and-no-need-words-from-paragraphs.html)

kylin 11-03-2009 09:44 PM

how to remove the punctuation and no need words from paragraphs
 
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.

Chris Rebert 11-04-2009 07:42 AM

Re: how to remove the punctuation and no need words from paragraphs
 
On Tue, Nov 3, 2009 at 1:44 PM, kylin <huili.song@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/stdty...ml#str.replace

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


All times are GMT. The time now is 08:11 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.