Skip to content

Commit

Permalink
Fix stowords filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
PrimozGodec committed Sep 30, 2019
1 parent 70be2b8 commit 4916dd9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions orangecontrib/text/preprocess/filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def supported_languages():
except LookupError: # when no NLTK data is available
pass

return [file.capitalize() for file in stopwords_listdir]
return sorted(file.capitalize() for file in stopwords_listdir)

@wait_nltk_data
def __init__(self, language='English', word_list=None):
Expand All @@ -96,7 +96,8 @@ def language(self, value):
if not self._language:
self.stopwords = []
else:
self.stopwords = set(stopwords.words(self.language.lower()))
self.stopwords = set(
x.strip() for x in stopwords.words(self.language.lower()))

def __str__(self):
config = ''
Expand Down

0 comments on commit 4916dd9

Please sign in to comment.