Deleted unneeded comments and checks

This commit is contained in:
Crista Lopes
2013-12-29 20:59:09 -08:00
parent 00e3b89f89
commit c2196f57da
6 changed files with 7 additions and 46 deletions

View File

@@ -1,11 +1,6 @@
import sys, re, string
def extract_words(path_to_file):
"""
Takes a path to a file and returns the non-stop
words, after properly removing nonalphanumeric chars
and normalizing for lower case
"""
words = re.findall('[a-z]{2,}', open(path_to_file).read().lower())
stopwords = set(open('../stop_words.txt').read().split(','))
return [w for w in words if w not in stopwords]