]> git.openstreetmap.org Git - nominatim.git/commitdiff
cache translieration results
authorSarah Hoffmann <lonvia@denofr.de>
Sun, 2 May 2021 20:13:18 +0000 (22:13 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Wed, 5 May 2021 08:15:27 +0000 (10:15 +0200)
nominatim/tokenizer/legacy_icu_tokenizer.py

index 064b395c6a8a88d7d1f22230fbd463852241f3b9..c819e9ef7b29bf877498cb7c6aa5785a5b76149d 100644 (file)
@@ -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.
         """