This preview shows page 1. Sign up to view the full content.
Unformatted text preview: # so simply count these characters sentences += line.count('.') + line.count('!') + line.count('?') # create a list of words # use None to split at any whitespace regardless of length # so for instance double space counts as one space tempwords = line.split(None) print tempwords # test # word total count words += len(tempwords) textf.close() print '-' * 50 print "Lines : ", lines print "Blank lines: ", blanklines print "Sentences : ", sentences print "Words : ", words...
View Full Document
This note was uploaded on 09/06/2009 for the course LING 571 taught by Professor Staff during the Fall '08 term at San Diego State.
- Fall '08