This preview shows page 1. Sign up to view the full content.
Unformatted text preview: # word total count words += len(line.split()) ns += line.count('and')+ line.count('but')+ line.count('because') average = float(words)/float(sentences) ss = (float(sentences)-float(ns)) print '%1s %5i %1s %1i %11s %8.2f'% (filename,ns,':',ss,'|',average) Counter('text1.txt') Counter('text2.txt') Counter('text3.txt')...
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