1 # SPDX-License-Identifier: GPL-3.0-or-later
 
   3 # This file is part of Nominatim. (https://nominatim.org)
 
   5 # Copyright (C) 2024 by the Nominatim developer community.
 
   6 # For a full list of authors see the git log.
 
   8 Configuration for Sanitizers.
 
  10 from typing import Any, TYPE_CHECKING
 
  11 from collections import UserDict
 
  13 # working around missing generics in Python < 3.8
 
  14 # See https://github.com/python/typing/issues/60#issuecomment-869757075
 
  16     _BaseUserDict = UserDict[str, Any]
 
  18     _BaseUserDict = UserDict
 
  21 class QueryConfig(_BaseUserDict):
 
  22     """ The `QueryConfig` class is a read-only dictionary
 
  23         with configuration options for the preprocessor.
 
  24         In addition to the usual dictionary functions, the class provides
 
  25         accessors to standard preprocessor options that are used by many of the
 
  29     def set_normalizer(self, normalizer: Any) -> 'QueryConfig':
 
  30         """ Set the normalizer function to be used.
 
  32         self['_normalizer'] = normalizer