author | Christopher Burns <chris.d.burns@gmail.com> |
Tue, 29 Jun 2010 00:59:26 -0500 | |
branch | scipy2010 |
changeset 432 | 13e5d0e2cd40 |
parent 380 | 669b72283b55 |
permissions | -rw-r--r-- |
64
333092b68926
Added quiz tex file and all exercise problems Madhu worked out.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff
changeset
|
1 |
freq = {} |
333092b68926
Added quiz tex file and all exercise problems Madhu worked out.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff
changeset
|
2 |
for line in f: |
333092b68926
Added quiz tex file and all exercise problems Madhu worked out.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff
changeset
|
3 |
words = line.split() |
333092b68926
Added quiz tex file and all exercise problems Madhu worked out.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff
changeset
|
4 |
for word in words: |
333092b68926
Added quiz tex file and all exercise problems Madhu worked out.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff
changeset
|
5 |
key = word.strip(',.!;?()[]: ') |
333092b68926
Added quiz tex file and all exercise problems Madhu worked out.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff
changeset
|
6 |
if keyword.iskeyword(key): |
180
e442b9e23972
Made English and low level id changes to session1.tex
rivermaker@RivermakerMBP.local
parents:
86
diff
changeset
|
7 |
if key in freq: |
e442b9e23972
Made English and low level id changes to session1.tex
rivermaker@RivermakerMBP.local
parents:
86
diff
changeset
|
8 |
freq[key] += 1 |
e442b9e23972
Made English and low level id changes to session1.tex
rivermaker@RivermakerMBP.local
parents:
86
diff
changeset
|
9 |
else: |
e442b9e23972
Made English and low level id changes to session1.tex
rivermaker@RivermakerMBP.local
parents:
86
diff
changeset
|
10 |
freq[key] = 1 |
64
333092b68926
Added quiz tex file and all exercise problems Madhu worked out.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff
changeset
|
11 |
|
333092b68926
Added quiz tex file and all exercise problems Madhu worked out.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff
changeset
|
12 |
print freq |
333092b68926
Added quiz tex file and all exercise problems Madhu worked out.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff
changeset
|
13 |