harmonize spelling

Stick with the American spelling of Analyze.
This commit is contained in:
Sarah Hoffmann
2022-07-29 10:52:01 +02:00
parent c8873d34af
commit 094100bbf6
3 changed files with 9 additions and 9 deletions

View File

@@ -20,7 +20,7 @@ from nominatim.db.connection import Connection
from nominatim.errors import UsageError from nominatim.errors import UsageError
from nominatim.tokenizer.place_sanitizer import PlaceSanitizer from nominatim.tokenizer.place_sanitizer import PlaceSanitizer
from nominatim.tokenizer.icu_token_analysis import ICUTokenAnalysis from nominatim.tokenizer.icu_token_analysis import ICUTokenAnalysis
from nominatim.tokenizer.token_analysis.base import AnalysisModule, Analyser from nominatim.tokenizer.token_analysis.base import AnalysisModule, Analyzer
import nominatim.data.country_info import nominatim.data.country_info
LOG = logging.getLogger() LOG = logging.getLogger()
@@ -190,7 +190,7 @@ class TokenAnalyzerRule:
transliterator) transliterator)
def create(self, normalizer: Any, transliterator: Any) -> Analyser: def create(self, normalizer: Any, transliterator: Any) -> Analyzer:
""" Create a new analyser instance for the given rule. """ Create a new analyser instance for the given rule.
""" """
return self._analysis_mod.create(normalizer, transliterator, self.config) return self._analysis_mod.create(normalizer, transliterator, self.config)

View File

@@ -11,7 +11,7 @@ into a Nominatim token.
from typing import Mapping, Optional, TYPE_CHECKING from typing import Mapping, Optional, TYPE_CHECKING
from icu import Transliterator from icu import Transliterator
from nominatim.tokenizer.token_analysis.base import Analyser from nominatim.tokenizer.token_analysis.base import Analyzer
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import Any from typing import Any
@@ -19,7 +19,7 @@ if TYPE_CHECKING:
class ICUTokenAnalysis: class ICUTokenAnalysis:
""" Container class collecting the transliterators and token analysis """ Container class collecting the transliterators and token analysis
modules for a single NameAnalyser instance. modules for a single Analyser instance.
""" """
def __init__(self, norm_rules: str, trans_rules: str, def __init__(self, norm_rules: str, trans_rules: str,
@@ -36,7 +36,7 @@ class ICUTokenAnalysis:
for name, arules in analysis_rules.items()} for name, arules in analysis_rules.items()}
def get_analyzer(self, name: Optional[str]) -> Analyser: def get_analyzer(self, name: Optional[str]) -> Analyzer:
""" Return the given named analyzer. If no analyzer with that """ Return the given named analyzer. If no analyzer with that
name exists, return the default analyzer. name exists, return the default analyzer.
""" """

View File

@@ -11,7 +11,7 @@ from typing import Mapping, List, Any
from nominatim.typing import Protocol from nominatim.typing import Protocol
class Analyser(Protocol): class Analyzer(Protocol):
""" The `create()` function of an analysis module needs to return an """ The `create()` function of an analysis module needs to return an
object that implements the following functions. object that implements the following functions.
""" """
@@ -49,7 +49,7 @@ class AnalysisModule(Protocol):
used freely by the analysis module as needed. used freely by the analysis module as needed.
""" """
def create(self, normalizer: Any, transliterator: Any, config: Any) -> Analyser: def create(self, normalizer: Any, transliterator: Any, config: Any) -> Analyzer:
""" Create a new instance of the analyser. """ Create a new instance of the analyser.
A separate instance of the analyser is created for each thread A separate instance of the analyser is created for each thread
when used in multi-threading context. when used in multi-threading context.
@@ -62,6 +62,6 @@ class AnalysisModule(Protocol):
config: The object that was returned by the call to configure(). config: The object that was returned by the call to configure().
Returns: Returns:
A new analyzer instance. This must be a class that implements A new analyzer instance. This must be an object that implements
the Analyser protocol. the Analyzer protocol.
""" """