mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-26 11:08:13 +00:00
reintroduce 'name:' prefix to country name keys
This commit is contained in:
@@ -7,12 +7,12 @@
|
|||||||
"""
|
"""
|
||||||
Functions for importing and managing static country information.
|
Functions for importing and managing static country information.
|
||||||
"""
|
"""
|
||||||
|
import json
|
||||||
import psycopg2.extras
|
import psycopg2.extras
|
||||||
|
|
||||||
from nominatim.db import utils as db_utils
|
from nominatim.db import utils as db_utils
|
||||||
from nominatim.db.connection import connect
|
from nominatim.db.connection import connect
|
||||||
from io import StringIO
|
from io import StringIO
|
||||||
import json
|
|
||||||
|
|
||||||
class _CountryInfo:
|
class _CountryInfo:
|
||||||
""" Caches country-specific properties from the configuration file.
|
""" Caches country-specific properties from the configuration file.
|
||||||
@@ -109,8 +109,8 @@ def create_country_names(conn, tokenizer, languages=None):
|
|||||||
languages = languages.split(',')
|
languages = languages.split(',')
|
||||||
|
|
||||||
def _include_key(key):
|
def _include_key(key):
|
||||||
return key == 'default' or \
|
return key == 'name' or \
|
||||||
(not languages or key in languages)
|
(key.startswith('name:') and (not languages or key[5:] in languages))
|
||||||
|
|
||||||
with conn.cursor() as cur:
|
with conn.cursor() as cur:
|
||||||
psycopg2.extras.register_hstore(cur)
|
psycopg2.extras.register_hstore(cur)
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user