diff --git a/spacy/tokens/span.pyx b/spacy/tokens/span.pyx index d3958242e..c55de3c3e 100644 --- a/spacy/tokens/span.pyx +++ b/spacy/tokens/span.pyx @@ -31,7 +31,7 @@ cdef class Span: Returns: Span The newly constructed object. ''' - if not (0 <= start <= end <= len(tokens)): + if not (0 <= start <= end <= len(doc)): raise IndexError self.doc = doc