From 5bb66940a98e91caf01b0093b84735f623da346f Mon Sep 17 00:00:00 2001 From: oryx1729 <78848855+oryx1729@users.noreply.github.com> Date: Wed, 14 Apr 2021 16:03:48 +0200 Subject: [PATCH] Fix equality check in preprocessor (#969) --- haystack/preprocessor/preprocessor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/haystack/preprocessor/preprocessor.py b/haystack/preprocessor/preprocessor.py index 8923809b6..7252f9640 100644 --- a/haystack/preprocessor/preprocessor.py +++ b/haystack/preprocessor/preprocessor.py @@ -151,7 +151,7 @@ class PreProcessor(BasePreProcessor): if not split_length: raise Exception("split_length needs be set when using split_by.") - if split_respect_sentence_boundary and split_by is not "word": + if split_respect_sentence_boundary and split_by != "word": raise NotImplementedError("'split_respect_sentence_boundary=True' is only compatible with split_by='word'.") text = document["text"]