From d55fc392759f6f2ed2d39dfe94890a4ae0d4f0b7 Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Sun, 2 May 2021 22:13:18 +0200 Subject: [PATCH] cache translieration results --- nominatim/tokenizer/legacy_icu_tokenizer.py | 2 ++ 1 file changed, 2 insertions(+) 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. """ -- 2.39.5