mirror of
https://github.com/explosion/spaCy.git
synced 2025-01-12 18:26:30 +03:00
* Bug fixes to parse navigation
This commit is contained in:
parent
e013555b25
commit
018e0bfa24
|
@ -57,7 +57,7 @@ cdef class Token:
|
|||
cdef unicode _string
|
||||
|
||||
cdef const TokenC* c
|
||||
cdef int i
|
||||
cdef readonly int i
|
||||
cdef int array_len
|
||||
|
||||
|
||||
|
|
|
@ -344,7 +344,7 @@ cdef class Token:
|
|||
|
||||
elif ptr + ptr.head == self.c:
|
||||
yield Token.cinit(self.mem, self.vocab, self._string,
|
||||
ptr, self.i, self.array_len,
|
||||
ptr, ptr - (self.c - self.i), self.array_len,
|
||||
self._py, self._tag_strings, self._dep_strings)
|
||||
ptr += 1
|
||||
else:
|
||||
|
@ -363,7 +363,7 @@ cdef class Token:
|
|||
ptr += ptr.head
|
||||
elif ptr + ptr.head == self.c:
|
||||
yield Token.cinit(self.mem, self.vocab, self._string,
|
||||
ptr, self.i, self.array_len,
|
||||
ptr, ptr - (self.c - self.i), self.array_len,
|
||||
self._py, self._tag_strings, self._dep_strings)
|
||||
ptr -= 1
|
||||
else:
|
||||
|
@ -373,7 +373,7 @@ cdef class Token:
|
|||
def head(self):
|
||||
"""The token predicted by the parser to be the head of the current token."""
|
||||
return Token.cinit(self.mem, self.vocab, self._string,
|
||||
self.c + self.c.head, self.i, self.array_len,
|
||||
self.c + self.c.head, self.i + self.c.head, self.array_len,
|
||||
self._py, self._tag_strings, self._dep_strings)
|
||||
|
||||
@property
|
||||
|
|
Loading…
Reference in New Issue
Block a user