From 094100bbf6ca8e3cf835bdc6a1d5c3f7e20a59cc Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Fri, 29 Jul 2022 10:52:01 +0200 Subject: [PATCH] harmonize spelling Stick with the American spelling of Analyze. --- nominatim/tokenizer/icu_rule_loader.py | 4 ++-- nominatim/tokenizer/icu_token_analysis.py | 6 +++--- nominatim/tokenizer/token_analysis/base.py | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/nominatim/tokenizer/icu_rule_loader.py b/nominatim/tokenizer/icu_rule_loader.py index aeb8a323..4c36282c 100644 --- a/nominatim/tokenizer/icu_rule_loader.py +++ b/nominatim/tokenizer/icu_rule_loader.py @@ -20,7 +20,7 @@ from nominatim.db.connection import Connection from nominatim.errors import UsageError from nominatim.tokenizer.place_sanitizer import PlaceSanitizer 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 LOG = logging.getLogger() @@ -190,7 +190,7 @@ class TokenAnalyzerRule: 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. """ return self._analysis_mod.create(normalizer, transliterator, self.config) diff --git a/nominatim/tokenizer/icu_token_analysis.py b/nominatim/tokenizer/icu_token_analysis.py index 3c4d7298..7ea31e8e 100644 --- a/nominatim/tokenizer/icu_token_analysis.py +++ b/nominatim/tokenizer/icu_token_analysis.py @@ -11,7 +11,7 @@ into a Nominatim token. from typing import Mapping, Optional, TYPE_CHECKING from icu import Transliterator -from nominatim.tokenizer.token_analysis.base import Analyser +from nominatim.tokenizer.token_analysis.base import Analyzer if TYPE_CHECKING: from typing import Any @@ -19,7 +19,7 @@ if TYPE_CHECKING: class ICUTokenAnalysis: """ 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, @@ -36,7 +36,7 @@ class ICUTokenAnalysis: 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 name exists, return the default analyzer. """ diff --git a/nominatim/tokenizer/token_analysis/base.py b/nominatim/tokenizer/token_analysis/base.py index d17a626c..cf6347b5 100644 --- a/nominatim/tokenizer/token_analysis/base.py +++ b/nominatim/tokenizer/token_analysis/base.py @@ -11,7 +11,7 @@ from typing import Mapping, List, Any from nominatim.typing import Protocol -class Analyser(Protocol): +class Analyzer(Protocol): """ The `create()` function of an analysis module needs to return an object that implements the following functions. """ @@ -49,7 +49,7 @@ class AnalysisModule(Protocol): 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. A separate instance of the analyser is created for each thread when used in multi-threading context. @@ -62,6 +62,6 @@ class AnalysisModule(Protocol): config: The object that was returned by the call to configure(). Returns: - A new analyzer instance. This must be a class that implements - the Analyser protocol. + A new analyzer instance. This must be an object that implements + the Analyzer protocol. """ -- 2.45.1