log().comment(f"No tokenizer named '{name}' available. Database not set up properly.")
raise RuntimeError('Tokenizer not found')
- module = importlib.import_module(f'nominatim.api.search.{name}_tokenizer')
+ module = importlib.import_module(f'nominatim_api.api.search.{name}_tokenizer')
return cast(AbstractQueryAnalyzer, await module.create_query_analyzer(conn))
"""
from pathlib import Path
-PHPLIB_DIR = (Path(__file__) / '..' / '..' / '..' / 'lib-php').resolve()
+PHPLIB_DIR = None
SQLLIB_DIR = (Path(__file__) / '..' / '..' / '..' / 'lib-sql').resolve()
DATA_DIR = (Path(__file__) / '..' / '..' / '..' / 'data').resolve()
CONFIG_DIR = (Path(__file__) / '..' / '..' / '..' / 'settings').resolve()
else:
port = 8088
- server_module = importlib.import_module(f'nominatim.server.{args.engine}.server')
+ server_module = importlib.import_module(f'nominatim_db.server.{args.engine}.server')
app = server_module.get_application(args.project_dir)
uvicorn.run(app, host=host, port=port)
"Check the setting of NOMINATIM_TOKENIZER.", name)
raise UsageError('Tokenizer not found')
- return importlib.import_module('nominatim.tokenizer.' + name + '_tokenizer')
+ return importlib.import_module('nominatim_db.tokenizer.' + name + '_tokenizer')
def create_tokenizer(config: Configuration, init_db: bool = True,
raise UsageError("'analyzer' parameter needs to be simple string")
self._analysis_mod: AnalysisModule = \
- config.load_plugin_module(analyzer_name, 'nominatim.tokenizer.token_analysis')
+ config.load_plugin_module(analyzer_name, 'nominatim_db.tokenizer.token_analysis')
self.config = self._analysis_mod.configure(rules, normalizer,
transliterator)
raise UsageError("'step' attribute must be a simple string.")
module: SanitizerHandler = \
- config.load_plugin_module(func['step'], 'nominatim.tokenizer.sanitizers')
+ config.load_plugin_module(func['step'], 'nominatim_db.tokenizer.sanitizers')
self.handlers.append(module.create(SanitizerConfig(func)))