Refactored Caching, Refactored BnfNodeParser, Introduced Sphinx

This commit is contained in:
2020-05-12 17:21:10 +02:00
parent 7d3a490bc5
commit 6e343ba996
110 changed files with 13865 additions and 7540 deletions
+18
View File
@@ -0,0 +1,18 @@
from cache.Cache import Cache
class IncCache(Cache):
"""
Increment the value of the key every time it's accessed
"""
def _get(self, key):
value = super()._get(key) or 0
value += 1
self._put(key, value)
return value
def _put(self, key, value):
self._cache[key] = value
self._add_to_add(key)
return True