From: Sarah Hoffmann Date: Sun, 2 May 2021 20:13:18 +0000 (+0200) Subject: cache translieration results X-Git-Tag: v4.0.0~91^2~4 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/d55fc392759f6f2ed2d39dfe94890a4ae0d4f0b7 cache translieration results --- diff --git a/nominatim/tokenizer/legacy_icu_tokenizer.py b/nominatim/tokenizer/legacy_icu_tokenizer.py index 064b395c..c819e9ef 100644 --- a/nominatim/tokenizer/legacy_icu_tokenizer.py +++ b/nominatim/tokenizer/legacy_icu_tokenizer.py @@ -3,6 +3,7 @@ Tokenizer implementing normalisation as used before Nominatim 4 but using libICU instead of the PostgreSQL module. """ from collections import Counter +import functools import io import itertools import json @@ -232,6 +233,7 @@ class LegacyICUNameAnalyzer: """ return self.normalizer.transliterate(phrase) + @functools.lru_cache(maxsize=1024) def make_standard_word(self, name): """ Create the normalised version of the name. """