]> git.openstreetmap.org Git - nominatim.git/commitdiff
Merge remote-tracking branch 'upstream/master'
authorSarah Hoffmann <lonvia@denofr.de>
Fri, 10 Jan 2025 19:58:34 +0000 (20:58 +0100)
committerSarah Hoffmann <lonvia@denofr.de>
Fri, 10 Jan 2025 19:58:34 +0000 (20:58 +0100)
1  2 
packaging/nominatim-db/pyproject.toml
src/nominatim_api/search/db_search_builder.py
src/nominatim_api/search/icu_tokenizer.py

Simple merge
index ac78d03c1fc1776667d3cb31020cc03bfa0c5a90,6f1dcf7902ab65e5a4481d6a3d7b65e6274deab8..8f2069c1a8bc57212956d1ce64d3a5914c12f920
@@@ -164,14 -206,10 +206,16 @@@ class ICUQueryAnalyzer(AbstractQueryAna
              tokenized query.
          """
          log().section('Analyze query (using ICU tokenizer)')
-         normalized = list(filter(lambda p: p.text,
-                                  (qmod.Phrase(p.ptype, self.normalize_text(p.text))
-                                   for p in phrases)))
-         if len(normalized) == 1 \
-                 and normalized[0].text.count(' ') > 3 \
-                 and max(len(s) for s in normalized[0].text.split()) < 3:
+         for func in self.preprocessors:
+             phrases = func(phrases)
++
++        if len(phrases) == 1 \
++                and phrases[0].text.count(' ') > 3 \
++                and max(len(s) for s in phrases[0].text.split()) < 3:
 +            normalized = []
-         query = qmod.QueryStruct(normalized)
++
+         query = qmod.QueryStruct(phrases)
          log().var_dump('Normalized query', query.source)
          if not query.source:
              return query