mirror of
https://github.com/explosion/spaCy.git
synced 2024-11-10 19:57:17 +03:00
* Fix whitespace attachment in simpler way. Leaves problem with setting left/right children.
This commit is contained in:
parent
883ff1f59e
commit
37919eac82
|
@ -384,10 +384,7 @@ cdef class ArcEager(TransitionSystem):
|
|||
for i in range(st.length):
|
||||
# Always attach spaces to the previous word
|
||||
if Lexeme.c_check_flag(st._sent[i].lex, IS_SPACE):
|
||||
if i >= 1:
|
||||
st.add_arc(i-1, i, st._sent[i].dep)
|
||||
else:
|
||||
st.add_arc(i+1, i, st._sent[i].dep)
|
||||
st._sent[i].head = -1 if (i >= 1) else 1
|
||||
if st._sent[i].sent_start and st._sent[i].head == -1:
|
||||
st._sent[i].sent_start = False
|
||||
# If we had this space token as the start of a sentence,
|
||||
|
|
Loading…
Reference in New Issue
Block a user