mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-03-11 05:14:07 +00:00
Documentation update and small code fixes
This commit is contained in:
@@ -61,7 +61,7 @@ class SPImporter():
|
||||
for phrase in loaded_phrases:
|
||||
result = self._process_phrase(phrase)
|
||||
if result:
|
||||
class_type_pairs.update(result)
|
||||
class_type_pairs.add(result)
|
||||
|
||||
self._create_place_classtype_table_and_indexes(class_type_pairs)
|
||||
if should_replace:
|
||||
@@ -143,7 +143,7 @@ class SPImporter():
|
||||
self.word_phrases.add((phrase.p_label, phrase.p_class,
|
||||
phrase.p_type, phrase.p_operator))
|
||||
|
||||
return set({(phrase.p_class, phrase.p_type)})
|
||||
return (phrase.p_class, phrase.p_type)
|
||||
|
||||
|
||||
def _create_place_classtype_table_and_indexes(self, class_type_pairs):
|
||||
|
||||
@@ -13,15 +13,13 @@ class SPWikiLoader(Iterator):
|
||||
Handles loading of special phrases from the wiki.
|
||||
"""
|
||||
def __init__(self, config, languages=None):
|
||||
if languages is not None and not isinstance(languages, list):
|
||||
raise TypeError('The \'languages\' parameter should be of type list.')
|
||||
super().__init__()
|
||||
self.config = config
|
||||
#Compile the regex here to increase performances.
|
||||
self.occurence_pattern = re.compile(
|
||||
r'\| *([^\|]+) *\|\| *([^\|]+) *\|\| *([^\|]+) *\|\| *([^\|]+) *\|\| *([\-YN])'
|
||||
)
|
||||
self.languages = self._load_languages() if not languages else languages
|
||||
self.languages = self._load_languages() if not languages else list(languages)
|
||||
|
||||
def __next__(self):
|
||||
if not self.languages:
|
||||
|
||||
Reference in New Issue
Block a user