Another renumbering, so that all concurrent styles are bundled together

This commit is contained in:
Crista Lopes
2013-12-27 15:41:39 -08:00
parent de06b9b09c
commit 750016ac52
39 changed files with 0 additions and 72 deletions

View File

@@ -0,0 +1,12 @@
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]