X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/2cdbcac353805767df011edc494f8067f9409f63..62e2da1f937882bf55363b0f10d8625200850642:/nominatim/tokenizer/legacy_tokenizer.py diff --git a/nominatim/tokenizer/legacy_tokenizer.py b/nominatim/tokenizer/legacy_tokenizer.py index b720bbdd..28f4b327 100644 --- a/nominatim/tokenizer/legacy_tokenizer.py +++ b/nominatim/tokenizer/legacy_tokenizer.py @@ -1,3 +1,9 @@ +# SPDX-License-Identifier: GPL-2.0-only +# +# This file is part of Nominatim. (https://nominatim.org) +# +# Copyright (C) 2022 by the Nominatim developer community. +# For a full list of authors see the git log. """ Tokenizer implementing normalisation as used before Nominatim 4. """ @@ -205,6 +211,13 @@ class LegacyTokenizer(AbstractTokenizer): cur.drop_table("word_frequencies") conn.commit() + + def update_word_tokens(self): + """ No house-keeping implemented for the legacy tokenizer. + """ + LOG.info("No tokenizer clean-up available.") + + def name_analyzer(self): """ Create a new analyzer for tokenizing names and queries using this tokinzer. Analyzers are context managers and should @@ -502,7 +515,7 @@ class _TokenInfo: simple_list = list(set(simple_list)) with conn.cursor() as cur: - cur.execute("SELECT (create_housenumbers(%s)).* ", (simple_list, )) + cur.execute("SELECT * FROM create_housenumbers(%s)", (simple_list, )) self.data['hnr_tokens'], self.data['hnr'] = cur.fetchone()