X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/e85f7e7aa9b9c297b6b5f266d811c935af8cbb9e..9025b0ec78bd770e74a1bed85c8d2e43ce5f571a:/nominatim/tokenizer/icu_name_processor.py diff --git a/nominatim/tokenizer/icu_name_processor.py b/nominatim/tokenizer/icu_name_processor.py index 6ead712e..28719df1 100644 --- a/nominatim/tokenizer/icu_name_processor.py +++ b/nominatim/tokenizer/icu_name_processor.py @@ -105,6 +105,11 @@ class ICUNameProcessor: partials = [v + done + r for v, r in itertools.product(partials, repl) if not force_space or r.startswith(' ')] + if len(partials) > 128: + # If too many variants are produced, they are unlikely + # to be helpful. Only use the original term. + startpos = 0 + break startpos = pos + len(full) if full[-1] == ' ': startpos -= 1