In remove_stop_words, echo back the word list if the stop words file fails.
This commit is contained in:
@@ -28,7 +28,7 @@ def remove_stop_words(word_list):
|
|||||||
stop_words = f.read().split(',')
|
stop_words = f.read().split(',')
|
||||||
except IOError as e:
|
except IOError as e:
|
||||||
print "I/O error({0}) when opening ../stops_words.txt: {1}".format(e.errno, e.strerror)
|
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))
|
stop_words.extend(list(string.ascii_lowercase))
|
||||||
return [w for w in word_list if not w in stop_words]
|
return [w for w in word_list if not w in stop_words]
|
||||||
|
|||||||
Reference in New Issue
Block a user