forked from hans/Nominatim
docs: fix typos
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
# Copyright (C) 2022 by the Nominatim developer community.
|
||||
# For a full list of authors see the git log.
|
||||
"""
|
||||
Abstract class defintions for tokenizers. These base classes are here
|
||||
Abstract class definitions for tokenizers. These base classes are here
|
||||
mainly for documentation purposes.
|
||||
"""
|
||||
from abc import ABC, abstractmethod
|
||||
@@ -113,7 +113,7 @@ class AbstractAnalyzer(ABC):
|
||||
the search index.
|
||||
|
||||
Arguments:
|
||||
place: Place information retrived from the database.
|
||||
place: Place information retrieved from the database.
|
||||
|
||||
Returns:
|
||||
A JSON-serialisable structure that will be handed into
|
||||
@@ -141,7 +141,7 @@ class AbstractTokenizer(ABC):
|
||||
|
||||
init_db: When set to False, then initialisation of database
|
||||
tables should be skipped. This option is only required for
|
||||
migration purposes and can be savely ignored by custom
|
||||
migration purposes and can be safely ignored by custom
|
||||
tokenizers.
|
||||
|
||||
TODO: can we move the init_db parameter somewhere else?
|
||||
|
||||
@@ -9,11 +9,11 @@ Functions for creating a tokenizer or initialising the right one for an
|
||||
existing database.
|
||||
|
||||
A tokenizer is something that is bound to the lifetime of a database. It
|
||||
can be choosen and configured before the intial import but then needs to
|
||||
can be chosen and configured before the initial import but then needs to
|
||||
be used consistently when querying and updating the database.
|
||||
|
||||
This module provides the functions to create and configure a new tokenizer
|
||||
as well as instanciating the appropriate tokenizer for updating an existing
|
||||
as well as instantiating the appropriate tokenizer for updating an existing
|
||||
database.
|
||||
|
||||
A tokenizer usually also includes PHP code for querying. The appropriate PHP
|
||||
|
||||
@@ -38,7 +38,7 @@ def create(dsn: str, data_dir: Path) -> 'ICUTokenizer':
|
||||
|
||||
|
||||
class ICUTokenizer(AbstractTokenizer):
|
||||
""" This tokenizer uses libICU to covert names and queries to ASCII.
|
||||
""" This tokenizer uses libICU to convert names and queries to ASCII.
|
||||
Otherwise it uses the same algorithms and data structures as the
|
||||
normalization routines in Nominatim 3.
|
||||
"""
|
||||
@@ -431,7 +431,7 @@ class ICUNameAnalyzer(AbstractAnalyzer):
|
||||
def _remove_special_phrases(self, cursor: Cursor,
|
||||
new_phrases: Set[Tuple[str, str, str, str]],
|
||||
existing_phrases: Set[Tuple[str, str, str, str]]) -> int:
|
||||
""" Remove all phrases from the databse that are no longer in the
|
||||
""" Remove all phrases from the database that are no longer in the
|
||||
new phrase list.
|
||||
"""
|
||||
to_delete = existing_phrases - new_phrases
|
||||
@@ -620,7 +620,7 @@ class ICUNameAnalyzer(AbstractAnalyzer):
|
||||
|
||||
def _retrieve_full_tokens(self, name: str) -> List[int]:
|
||||
""" Get the full name token for the given name, if it exists.
|
||||
The name is only retrived for the standard analyser.
|
||||
The name is only retrieved for the standard analyser.
|
||||
"""
|
||||
assert self.conn is not None
|
||||
norm_name = self._search_normalized(name)
|
||||
|
||||
@@ -59,7 +59,7 @@ class _PostcodeSanitizer:
|
||||
def scan(self, postcode: str, country: Optional[str]) -> Optional[Tuple[str, str]]:
|
||||
""" Check the postcode for correct formatting and return the
|
||||
normalized version. Returns None if the postcode does not
|
||||
correspond to the oficial format of the given country.
|
||||
correspond to the official format of the given country.
|
||||
"""
|
||||
match = self.matcher.match(country, postcode)
|
||||
if match is None:
|
||||
|
||||
@@ -90,7 +90,7 @@ class SanitizerConfig(_BaseUserDict):
|
||||
True when the item passes the filter.
|
||||
|
||||
If the parameter is empty, the filter lets all items pass. If the
|
||||
paramter is a string, it is interpreted as a single regular expression
|
||||
parameter is a string, it is interpreted as a single regular expression
|
||||
that must match the full kind string. If the parameter is a list then
|
||||
any of the regular expressions in the list must match to pass.
|
||||
"""
|
||||
|
||||
@@ -58,7 +58,7 @@ def get_variant_config(in_rules: Any,
|
||||
|
||||
|
||||
class _VariantMaker:
|
||||
""" Generater for all necessary ICUVariants from a single variant rule.
|
||||
""" Generator for all necessary ICUVariants from a single variant rule.
|
||||
|
||||
All text in rules is normalized to make sure the variants match later.
|
||||
"""
|
||||
|
||||
@@ -23,7 +23,7 @@ def _zigzag(outer: Iterable[str], inner: Iterable[str]) -> Iterator[str]:
|
||||
class MutationVariantGenerator:
|
||||
""" Generates name variants by applying a regular expression to the name
|
||||
and replacing it with one or more variants. When the regular expression
|
||||
matches more than once, each occurence is replaced with all replacement
|
||||
matches more than once, each occurrence is replaced with all replacement
|
||||
patterns.
|
||||
"""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user