From edd38a84b176c3c77d997ae52e2949614d1f2b6a Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Sat, 2 Aug 2014 20:45:12 +0100 Subject: [PATCH] * Removing happax stuff. Added length --- spacy/spacy.pyx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/spacy/spacy.pyx b/spacy/spacy.pyx index 07800faf8..d3157ded7 100644 --- a/spacy/spacy.pyx +++ b/spacy/spacy.pyx @@ -138,7 +138,7 @@ cdef class Language: return word_ptr cdef int _happax_to_vocab(self, StringHash hashed, Lexeme_addr word_ptr): - self.vocab[0][hashed] = word_ptr + self.vocab[0][hashed] = word_ptr self.happax.erase(hashed) cdef Lexeme* _add(self, StringHash hashed, unicode string, int split, size_t length): @@ -146,7 +146,8 @@ cdef class Language: word = self.init_lexeme(string, hashed, split, length) cdef Lexeme* clobbered = self.happax.insert(hashed, word) if clobbered != NULL: - free(clobbered) + #free(clobbered) + pass self.bacov[hashed] = string return word @@ -219,7 +220,8 @@ cdef class Language: orth.first = lex[0] cdef int length = len(lex) - + + orth.length = length orth.flags = set_orth_flags(lex, length) cdef unicode last3 = substr(lex, length - 3, length, length)