diff --git a/spacy/tests/doc/test_token_api.py b/spacy/tests/doc/test_token_api.py index 959ff017b..2f784e678 100644 --- a/spacy/tests/doc/test_token_api.py +++ b/spacy/tests/doc/test_token_api.py @@ -99,8 +99,8 @@ def test_doc_token_api_ancestors(en_tokenizer): assert [t.text for t in doc[1].ancestors] == ["saw"] assert [t.text for t in doc[2].ancestors] == [] - assert doc[2].is_ancestor_of(doc[7]) - assert not doc[6].is_ancestor_of(doc[2]) + assert doc[2].is_ancestor(doc[7]) + assert not doc[6].is_ancestor(doc[2]) def test_doc_token_api_head_setter(en_tokenizer): diff --git a/spacy/tokens/token.pyx b/spacy/tokens/token.pyx index 68c19f4b5..fb459b155 100644 --- a/spacy/tokens/token.pyx +++ b/spacy/tokens/token.pyx @@ -407,7 +407,7 @@ cdef class Token: cdef int rel_newhead_i = new_head.i - self.i # is the new head a descendant of the old head - cdef bint is_desc = old_head.is_ancestor_of(new_head) + cdef bint is_desc = old_head.is_ancestor(new_head) cdef int new_edge cdef Token anc, child