Created
January 14, 2010 20:46
-
-
Save russelnickson/277490 to your computer and use it in GitHub Desktop.
parse words... my creation... yea..
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import shlex | |
import string | |
f=open(sys.argv[1]) | |
content=f.read() | |
sen=string.split(content,'.') | |
print sen | |
words=[] | |
for i in range(len(sen)): | |
w=shlex.split(sen[i]) | |
words=words+w | |
print 'word count = '+ str(len(words)) | |
print words |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment