And this one too

This commit is contained in:
Crista Lopes
2014-03-14 10:34:01 -07:00
parent b5b606cbbd
commit ccbd13c268
12 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
import sys, re, string
def extract_words(path_to_file):
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]