<commit_before>"""
 OpenStreetMap (Map)

 @website     https://openstreetmap.org/
 @provide-api yes (http://wiki.openstreetmap.org/wiki/Nominatim)

 @using-api   yes
 @results     JSON
 @stable      yes
 @parse       url, title
"""

from json import loads

# engine dependent config
categories = ['map']
paging = False

# search-url
base_url = 'https://nominatim.openstreetmap.org/'
search_string = 'search/{query}?format=json&polygon_geojson=1&addressdetails=1'
result_base_url = 'https://openstreetmap.org/{osm_type}/{osm_id}'


# do search-request
def request(query, params):
    params['url'] = base_url + search_string.format(query=query)

    return params
<commit_msg>[fix] convert byte query to string in osm engine - fixes #1220<commit_after>"""
 OpenStreetMap (Map)

 @website     https://openstreetmap.org/
 @provide-api yes (http://wiki.openstreetmap.org/wiki/Nominatim)

 @using-api   yes
 @results     JSON
 @stable      yes
 @parse       url, title
"""

from json import loads

# engine dependent config
categories = ['map']
paging = False

# search-url
base_url = 'https://nominatim.openstreetmap.org/'
search_string = 'search/{query}?format=json&polygon_geojson=1&addressdetails=1'
result_base_url = 'https://openstreetmap.org/{osm_type}/{osm_id}'


# do search-request
def request(query, params):
    params['url'] = base_url + search_string.format(query=query.decode('utf-8'))

    return params

{'fraction_non_alphanumeric': 0.13851590106007067, 'fraction_numerical': 0.0063604240282685515, 'mean_word_length': 4.303370786516854, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6019926', 'n_tokens_mistral': 494, 'n_tokens_neox': 462, 'n_words': 100}