Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
heni committed Mar 4, 2016
1 parent 541c9b1 commit 07aa3d8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion sumy/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def read_stop_words(filename):


def parse_stop_words(data):
return frozenset(w.rstrip() for w in to_unicode(data).split("\n"))
return frozenset(w.rstrip() for w in to_unicode(data).split("\n") if w)


class ItemsCount(object):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_utils/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def test_missing_stop_words_language(self):

def test_ok_custom_stopwords_file(self):
stop_words = read_stop_words(expand_resource_path("stopwords/language.txt"))
self.assertEqual(len(stop_words), 5)
self.assertEqual(len(stop_words), 4)

def test_custom_stop_words_file_not_found(self):
self.assertRaises(IOError, read_stop_words, expand_resource_path("stopwords/klingon.txt"))
Expand Down

0 comments on commit 07aa3d8

Please sign in to comment.