Skip to content

Commit 044d518

Browse files
committed
ENH O(1) stop-word lookup when list provided
The docstring says stop_words can be a list, but it should be accessed as a set.
1 parent 5fa4d63 commit 044d518

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sklearn/feature_extraction/text.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def _check_stop_list(stop):
8989
elif isinstance(stop, six.string_types):
9090
raise ValueError("not a built-in stop list: %s" % stop)
9191
else: # assume it's a collection
92-
return stop
92+
return frozenset(stop)
9393

9494

9595
class VectorizerMixin(object):

0 commit comments

Comments
 (0)