コード例 #1
0
ファイル: __init__.py プロジェクト: ling-chi/geograpy3
def locateCity(location, correctMisspelling=False, debug=False):
    '''
    locate the given location string
    Args:
        location(string): the description of the location
    Returns:
        Locator: the location
    '''
    e = Extractor(text=location, debug=debug)
    e.split()
    loc = Locator.getInstance(correctMisspelling=correctMisspelling,
                              debug=debug)
    city = loc.locateCity(e.places)
    return city