From c7bb6b329c8a950df17248a3182fcf28e4ed397b Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Fri, 1 Aug 2014 08:22:38 +0100 Subject: [PATCH] * Don't free clobbered lexemes, as they might be part of a tail --- spacy/spacy.pyx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/spacy/spacy.pyx b/spacy/spacy.pyx index aca8795fa..68cb23aba 100644 --- a/spacy/spacy.pyx +++ b/spacy/spacy.pyx @@ -142,7 +142,10 @@ cdef class Language: word = self.init_lexeme(string, hashed, split, length) cdef Lexeme* clobbered = self.happax.insert(hashed, word) 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 return word