mirror of
https://github.com/explosion/spaCy.git
synced 2025-06-29 17:33:10 +03:00
* Fix merge problem in span
This commit is contained in:
parent
8a13cebdcc
commit
6aa92b70f1
|
@ -240,11 +240,10 @@ cdef class Span:
|
||||||
cdef int _count_words_to_root(const TokenC* token, int sent_length) except -1:
|
cdef int _count_words_to_root(const TokenC* token, int sent_length) except -1:
|
||||||
# Don't allow spaces to be the root, if there are
|
# Don't allow spaces to be the root, if there are
|
||||||
# better candidates
|
# better candidates
|
||||||
if Lexeme.c_check_flag(token.lex, IS_SPACE):
|
if Lexeme.c_check_flag(token.lex, IS_SPACE) and token.l_kids == 0 and token.r_kids == 0:
|
||||||
return sent_length-1
|
return sent_length-1
|
||||||
if Lexeme.c_check_flag(token.lex, IS_PUNCT):
|
if Lexeme.c_check_flag(token.lex, IS_PUNCT) and token.l_kids == 0 and token.r_kids == 0:
|
||||||
return sent_length-1
|
return sent_length-1
|
||||||
|
|
||||||
cdef int n = 0
|
cdef int n = 0
|
||||||
while token.head != 0:
|
while token.head != 0:
|
||||||
token += token.head
|
token += token.head
|
||||||
|
|
Loading…
Reference in New Issue
Block a user