equal
deleted
inserted
replaced
|
1 f = open('/home/madhu/pyprogs/pytriads.py') |
|
2 |
|
3 freq = {} |
|
4 for line in f: |
|
5 words = line.split() |
|
6 for word in words: |
|
7 key = word.strip(',.!;?\'" ') |
|
8 value = freq.get(key, 1) |
|
9 freq[key] = value + 1 |
|
10 |
|
11 print freq |