This commit is contained in:
Crista Lopes
2014-01-03 08:33:55 -08:00
parent 6ae1d8fec0
commit d20a3d6649

View File

@@ -1,5 +1,4 @@
#!/usr/bin/env python
import re, string, sys
with open("../stop_words.txt") as f:
@@ -29,7 +28,6 @@ def upload_post_handler(args):
if filename in data:
return
word_freqs = {}
print "Trying to open " + filename
with open(filename) as f:
for w in [x.lower() for x in re.split("[^a-zA-Z]+", f.read()) if len(x) > 0 and x.lower() not in stops]:
word_freqs[w] = word_freqs.get(w, 0) + 1