cache translieration results

This commit is contained in:
Sarah Hoffmann
2021-05-02 22:13:18 +02:00
parent ba8ed7967d
commit d55fc39275

View File

@@ -3,6 +3,7 @@ Tokenizer implementing normalisation as used before Nominatim 4 but using
libICU instead of the PostgreSQL module. libICU instead of the PostgreSQL module.
""" """
from collections import Counter from collections import Counter
import functools
import io import io
import itertools import itertools
import json import json
@@ -232,6 +233,7 @@ class LegacyICUNameAnalyzer:
""" """
return self.normalizer.transliterate(phrase) return self.normalizer.transliterate(phrase)
@functools.lru_cache(maxsize=1024)
def make_standard_word(self, name): def make_standard_word(self, name):
""" Create the normalised version of the name. """ Create the normalised version of the name.
""" """