mirror of https://github.com/explosion/spaCy.git
* Fix calculation of head for spans with punctuation.
This commit is contained in:
parent
84b247ef83
commit
4cbad510ff
|
@ -242,6 +242,8 @@ cdef int _count_words_to_root(const TokenC* token, int sent_length) except -1:
|
||||||
# better candidates
|
# better candidates
|
||||||
if Lexeme.c_check_flag(token.lex, IS_SPACE):
|
if Lexeme.c_check_flag(token.lex, IS_SPACE):
|
||||||
return sent_length-1
|
return sent_length-1
|
||||||
|
if Lexeme.c_check_flag(token.lex, IS_PUNCT):
|
||||||
|
return sent_length-1
|
||||||
|
|
||||||
cdef int n = 0
|
cdef int n = 0
|
||||||
while token.head != 0:
|
while token.head != 0:
|
||||||
|
|
Loading…
Reference in New Issue