diff --git a/spacy/tokens/token.pyx b/spacy/tokens/token.pyx index 5f18866e9..4fd24c0e5 100644 --- a/spacy/tokens/token.pyx +++ b/spacy/tokens/token.pyx @@ -336,7 +336,7 @@ cdef class Token: Returns: is_ancestor (bool): Whether this token is the ancestor of the descendant. ''' - if self.doc is not other.doc: + if self.doc is not descendant.doc: return False return any( ancestor.i == self.i for ancestor in descendant.ancestors )