mirror of https://github.com/explosion/spaCy.git
* Don't free clobbered lexemes, as they might be part of a tail
This commit is contained in:
parent
c48214460e
commit
c7bb6b329c
|
@ -142,7 +142,10 @@ cdef class Language:
|
||||||
word = self.init_lexeme(string, hashed, split, length)
|
word = self.init_lexeme(string, hashed, split, length)
|
||||||
cdef Lexeme* clobbered = <Lexeme*>self.happax.insert(hashed, <size_t>word)
|
cdef Lexeme* clobbered = <Lexeme*>self.happax.insert(hashed, <size_t>word)
|
||||||
if clobbered != NULL:
|
if clobbered != NULL:
|
||||||
free(clobbered)
|
# Can't do this --- we might be pointing to the Lexeme in .tail.
|
||||||
|
# Fix that to reduce memory, probably.
|
||||||
|
#free(clobbered)
|
||||||
|
pass
|
||||||
self.bacov[hashed] = string
|
self.bacov[hashed] = string
|
||||||
return word
|
return word
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue