From 4ef6bd171d00da01cbabc3bcde00088ba4bd5578 Mon Sep 17 00:00:00 2001 From: Adriane Boyd Date: Mon, 7 Mar 2022 14:28:02 +0100 Subject: [PATCH] Reset all caches when reloading special cases --- spacy/tokenizer.pyx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spacy/tokenizer.pyx b/spacy/tokenizer.pyx index 40b35c6f6..a3de7f86b 100644 --- a/spacy/tokenizer.pyx +++ b/spacy/tokenizer.pyx @@ -620,6 +620,8 @@ cdef class Tokenizer: def _reload_special_cases(self): self._flush_cache() self._flush_specials() + self._cache = PreshMap() + self._specials = PreshMap() self._load_special_cases(self._rules) def explain(self, text):