In remove_stop_words, echo back the word list if the stop words file fails.

This commit is contained in:
Crista Lopes
2013-12-01 10:12:33 -08:00
parent 9398293f16
commit 58be802d13

View File

@@ -28,7 +28,7 @@ def remove_stop_words(word_list):
stop_words = f.read().split(',')
except IOError as e:
print "I/O error({0}) when opening ../stops_words.txt: {1}".format(e.errno, e.strerror)
return []
return word_list
stop_words.extend(list(string.ascii_lowercase))
return [w for w in word_list if not w in stop_words]