X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/47417d18714143ad20316bd529694e94fa0a0e26..0ae8d7ac083983e1d7092fb5855c698acc5cb24c:/nominatim/clicmd/special_phrases.py diff --git a/nominatim/clicmd/special_phrases.py b/nominatim/clicmd/special_phrases.py index 626c0053..a4ef89a4 100644 --- a/nominatim/clicmd/special_phrases.py +++ b/nominatim/clicmd/special_phrases.py @@ -35,6 +35,13 @@ class ImportSpecialPhrases: An example file can be found in the Nominatim sources at 'test/testdb/full_en_phrases_test.csv'. + + The import can be further configured to ignore specific key/value pairs. + This is particularly useful when importing phrases from the wiki. The + default configuration excludes some very common tags like building=yes. + The configuration can be customized by putting a file `phrase-settings.json` + with custom rules into the project directory or by using the `--config` + option to point to another configuration file. """ @staticmethod def add_args(parser): @@ -45,6 +52,9 @@ class ImportSpecialPhrases: help='Import special phrases from a CSV file') group.add_argument('--no-replace', action='store_true', help='Keep the old phrases and only add the new ones') + group.add_argument('--config', action='store', + help='Configuration file for black/white listing ' + '(default: phrase-settings.json)') @staticmethod def run(args): @@ -72,5 +82,5 @@ class ImportSpecialPhrases: should_replace = not args.no_replace with connect(args.config.get_libpq_dsn()) as db_connection: SPImporter( - args.config, args.phplib_dir, db_connection, loader + args.config, db_connection, loader ).import_phrases(tokenizer, should_replace)