def search(coord, place_name):
"""Finds the Wikipedia page corresponding to the given place.
The current implementation requires Wikipedia geotags, meaning it'll miss:
- Chains (Starbucks)
- Corporate pages (Lagunitas, as opposed to the brewery site)
- Area-based things (49-mile drive in SF)
:param coord: is (latitude, longitude)
:return: A wikipedia page title.
"""
# We don't use the title arg of `wikipedia.geosearch`. It will return exact title matches, even if the geo location
# does not match, so "Boulevard" will return a street rather than the restaurant (which is "Boulevard (restaurant)").
wiki_page_titles = wikipedia.geosearch(*coord)
return _match_place_name_to_wiki_page(place_name, wiki_page_titles)
评论列表
文章目录