From d3d419ecc00d95d02d4af4e843107d471781ad8f Mon Sep 17 00:00:00 2001 From: Daniel Hershcovich Date: Tue, 13 Nov 2018 17:46:29 +0200 Subject: [PATCH] Allow input text of length up to max_length, inclusive (#2922) --- spacy/language.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spacy/language.py b/spacy/language.py index 758b3ef5f..d2e686c7f 100644 --- a/spacy/language.py +++ b/spacy/language.py @@ -334,7 +334,7 @@ class Language(object): >>> tokens[0].text, tokens[0].head.tag_ ('An', 'NN') """ - if len(text) >= self.max_length: + if len(text) > self.max_length: raise ValueError(Errors.E088.format(length=len(text), max_length=self.max_length)) doc = self.make_doc(text)