X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/0ae8d7ac083983e1d7092fb5855c698acc5cb24c..b8c544cc98bec8174d28cf6895dd47ddb9c7b57b:/nominatim/clicmd/refresh.py diff --git a/nominatim/clicmd/refresh.py b/nominatim/clicmd/refresh.py index 82a61f54..b8a88b6d 100644 --- a/nominatim/clicmd/refresh.py +++ b/nominatim/clicmd/refresh.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. """ Implementation of 'refresh' subcommand. """ @@ -33,6 +39,8 @@ class UpdateRefresh: group = parser.add_argument_group('Data arguments') group.add_argument('--postcodes', action='store_true', help='Update postcode centroid table') + group.add_argument('--word-tokens', action='store_true', + help='Clean up search terms') group.add_argument('--word-counts', action='store_true', help='Compute frequency of full-word search terms') group.add_argument('--address-levels', action='store_true', @@ -70,6 +78,11 @@ class UpdateRefresh: LOG.error("The place table doesn't exist. " "Postcode updates on a frozen database is not possible.") + if args.word_tokens: + LOG.warning('Updating word tokens') + tokenizer = self._get_tokenizer(args.config) + tokenizer.update_word_tokens() + if args.word_counts: LOG.warning('Recompute word statistics') self._get_tokenizer(args.config).update_statistics()