From 58be802d13fd4e3b10d40ad34165cb608633f898 Mon Sep 17 00:00:00 2001 From: Crista Lopes Date: Sun, 1 Dec 2013 10:12:33 -0800 Subject: [PATCH] In remove_stop_words, echo back the word list if the stop words file fails. --- 21-constructivist/tf-21.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/21-constructivist/tf-21.py b/21-constructivist/tf-21.py index 9403037..5e4c859 100755 --- a/21-constructivist/tf-21.py +++ b/21-constructivist/tf-21.py @@ -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]