From 104cb93d8b7d89cc930a3f2d80fa631de91b4801 Mon Sep 17 00:00:00 2001 From: Adriane Boyd Date: Tue, 10 Sep 2019 23:15:14 +0200 Subject: [PATCH] Remove reinitialized PreshMaps on cache flush --- spacy/tokenizer.pyx | 3 --- 1 file changed, 3 deletions(-) diff --git a/spacy/tokenizer.pyx b/spacy/tokenizer.pyx index 723e1f12e..badb0c795 100644 --- a/spacy/tokenizer.pyx +++ b/spacy/tokenizer.pyx @@ -199,8 +199,6 @@ cdef class Tokenizer: del self._cache[k] if cached is not NULL: self.mem.free(cached) - if len(self._cache) == 0: - self._cache = PreshMap() def _flush_specials(self): for k in self._specials: @@ -208,7 +206,6 @@ cdef class Tokenizer: del self._specials[k] if cached is not NULL: self.mem.free(cached) - self._specials = PreshMap() cdef int _apply_special_cases(self, Doc doc): """Retokenize doc according to special cases.