Skip to content

Commit 2b71bd5

Browse files
yyanhanAlir3z4dmiro
authored
modified get_stop_words(), preventing being changed from outside. (#31)
Co-authored-by: David Miró <davidmirom@hotmail.com> --------- Co-authored-by: Alireza Savand <alireza.savand@gmail.com> Co-authored-by: David Miró <davidmirom@hotmail.com>
1 parent c322451 commit 2b71bd5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

stop_words/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def get_stop_words(language, cache=True):
5858
if cache:
5959
STOP_WORDS_CACHE[language] = stop_words
6060

61-
return stop_words
61+
return stop_words[:] # copy list, prevent being modified
6262

6363
_filters = {None: []}
6464

0 commit comments

Comments
 (0)