mirror of
https://github.com/explosion/spaCy.git
synced 2025-01-30 11:14:08 +03:00
Remove reinitialized PreshMaps on cache flush
This commit is contained in:
parent
cf7047bbdf
commit
104cb93d8b
|
@ -199,8 +199,6 @@ cdef class Tokenizer:
|
||||||
del self._cache[k]
|
del self._cache[k]
|
||||||
if cached is not NULL:
|
if cached is not NULL:
|
||||||
self.mem.free(cached)
|
self.mem.free(cached)
|
||||||
if len(self._cache) == 0:
|
|
||||||
self._cache = PreshMap()
|
|
||||||
|
|
||||||
def _flush_specials(self):
|
def _flush_specials(self):
|
||||||
for k in self._specials:
|
for k in self._specials:
|
||||||
|
@ -208,7 +206,6 @@ cdef class Tokenizer:
|
||||||
del self._specials[k]
|
del self._specials[k]
|
||||||
if cached is not NULL:
|
if cached is not NULL:
|
||||||
self.mem.free(cached)
|
self.mem.free(cached)
|
||||||
self._specials = PreshMap()
|
|
||||||
|
|
||||||
cdef int _apply_special_cases(self, Doc doc):
|
cdef int _apply_special_cases(self, Doc doc):
|
||||||
"""Retokenize doc according to special cases.
|
"""Retokenize doc according to special cases.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user