Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def get_counts(filename):
- result_dict = {}
- file = open(filename)
- for line in file:
- if len(word) >= 1:
- normalize(word)
- for word in file:
- if word in result_dict:
- result_dict[word] += 1
- else:
- result_dict[word] = 1
- return result_dict
Advertisement
Add Comment
Please, Sign In to add comment