mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-03-11 21:34:06 +00:00
introduce tokenizer modules
This adds the boilerplate for selecting configurable tokenizers. A tokenizer can be chosen at import time and will then install itself such that it is fixed for the given database import even when the software itself is updated. The legacy tokenizer implements Nominatim's traditional algorithms.
This commit is contained in:
@@ -56,6 +56,7 @@ class SetupAll:
|
||||
from ..tools import refresh
|
||||
from ..indexer.indexer import Indexer
|
||||
from ..tools import postcodes
|
||||
from ..tokenizer import factory as tokenizer_factory
|
||||
|
||||
if args.osm_file and not Path(args.osm_file).is_file():
|
||||
LOG.fatal("OSM file '%s' does not exist.", args.osm_file)
|
||||
@@ -112,6 +113,10 @@ class SetupAll:
|
||||
args.data_dir,
|
||||
args.threads or psutil.cpu_count() or 1)
|
||||
|
||||
LOG.warning("Setting up tokenizer")
|
||||
tokenizer = tokenizer_factory.create_tokenizer(args.config)
|
||||
|
||||
if args.continue_at is None or args.continue_at == 'load-data':
|
||||
LOG.warning('Calculate postcodes')
|
||||
postcodes.import_postcodes(args.config.get_libpq_dsn(), args.project_dir)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user