From 9ccd6a3062110da5e8913299acb5e4b2830ab3fa Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Mon, 25 Feb 2019 21:21:44 +0100 Subject: [PATCH] Fix head-outside-sentence bug. Fixes #3170 --- spacy/tokens/doc.pyx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spacy/tokens/doc.pyx b/spacy/tokens/doc.pyx index ba0801e34..98c03f589 100644 --- a/spacy/tokens/doc.pyx +++ b/spacy/tokens/doc.pyx @@ -1000,8 +1000,8 @@ cdef int set_children_from_heads(TokenC* tokens, int length) except -1: tokens[i].r_kids = 0 tokens[i].l_edge = i tokens[i].r_edge = i - # Twice, for non-projectivity - for loop_count in range(2): + # Three times, for non-projectivity + for loop_count in range(3): # Set left edges for i in range(length): child = &tokens[i]