mirror of
https://github.com/explosion/spaCy.git
synced 2025-08-13 00:24:54 +03:00
Add GoldParse.resize_arrays method
This commit is contained in:
parent
cb6988f2f4
commit
fb9c3984b5
|
@ -592,6 +592,16 @@ cdef class GoldParse:
|
||||||
"""
|
"""
|
||||||
return self.length
|
return self.length
|
||||||
|
|
||||||
|
def resize_arrays(self, int new_size):
|
||||||
|
# These are filled by the tagger/parser/entity recogniser
|
||||||
|
self.c.tags = <int*>self.mem.realloc(self.c.tags, new_size * sizeof(int))
|
||||||
|
self.c.heads = <int*>self.mem.realloc(self.c.heads, new_size * sizeof(int))
|
||||||
|
self.c.labels = <attr_t*>self.mem.realloc(self.c.labels, new_size * sizeof(attr_t))
|
||||||
|
self.c.has_dep = <int*>self.mem.realloc(self.c.has_dep, new_size * sizeof(int))
|
||||||
|
self.c.sent_start = <int*>self.mem.realloc(self.c.sent_start, new_size * sizeof(int))
|
||||||
|
self.c.ner = <Transition*>self.mem.realloc(self.c.ner, new_size * sizeof(Transition))
|
||||||
|
self.c.fused = <int*>self.mem.realloc(self.c.fused, new_size * sizeof(int))
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def is_projective(self):
|
def is_projective(self):
|
||||||
"""Whether the provided syntactic annotations form a projective
|
"""Whether the provided syntactic annotations form a projective
|
||||||
|
|
Loading…
Reference in New Issue
Block a user