# Path: matcher/utils.py
# def normalize_url(url):
#     for start in "http://", "https://", "www.":
#         url = remove_start(url, start)
#     return url.rstrip("/")
# 
# def any_upper(value):
#     return any(c.isupper() for c in value)


from collections import defaultdict
from unidecode import unidecode
from num2words import num2words
from .utils import normalize_url, any_upper
from enum import Enum
import re
        for place_name in more_place_name_varients(place_names):
            if not (place_name in osm or place_name in wd):
                continue
            match = name_match_main(strip_place_name(osm, place_name),
                                    strip_place_name(wd, place_name),
                                    endings, debug)
            if match:
                return match

    if ';' not in osm:
        return
    for osm_name in osm.split(';'):
        match = name_match(osm_name.strip(), wd, endings=endings, debug=debug,
                           place_names=place_names)
        if match:
            return match

def ordinal_number_to_word(name):
    return re_ordinal_number.sub(lambda m: num2words(int(m.group(1)), to='ordinal'), name)

def normalize_name(name):
    name = ordinal_number_to_word(name)
    name = name.replace(' bij ', '')  # "at" in Dutch
    return re_strip_non_chars.sub('', name.lower())

def has_address(osm_tags):
    return any('addr:' + part in osm_tags for part in ('housenumber', 'full'))

def any_url_match(osm_value, values):
    osm_url = normalize_url(osm_value)

# Path: matcher/utils.py
# def normalize_url(url):
#     for start in "http://", "https://", "www.":
#         url = remove_start(url, start)
#     return url.rstrip("/")
# 
# def any_upper(value):
#     return any(c.isupper() for c in value)


# Path: matcher/match.py
from collections import defaultdict
from unidecode import unidecode
from num2words import num2words
from .utils import normalize_url, any_upper
from enum import Enum
import re

        for place_name in more_place_name_varients(place_names):
            if not (place_name in osm or place_name in wd):
                continue
            match = name_match_main(strip_place_name(osm, place_name),
                                    strip_place_name(wd, place_name),
                                    endings, debug)
            if match:
                return match

    if ';' not in osm:
        return
    for osm_name in osm.split(';'):
        match = name_match(osm_name.strip(), wd, endings=endings, debug=debug,
                           place_names=place_names)
        if match:
            return match

def ordinal_number_to_word(name):
    return re_ordinal_number.sub(lambda m: num2words(int(m.group(1)), to='ordinal'), name)

def normalize_name(name):
    name = ordinal_number_to_word(name)
    name = name.replace(' bij ', '')  # "at" in Dutch
    return re_strip_non_chars.sub('', name.lower())

def has_address(osm_tags):
    return any('addr:' + part in osm_tags for part in ('housenumber', 'full'))

def any_url_match(osm_value, values):
    osm_url = normalize_url(osm_value)

    return any(osm_url == normalize_url(wd_url) for wd_url in values)