From 872d7b219d0c0c5a9edd6f3f3982138b45078429 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arne=20Schl=C3=BCter?= Date: Sun, 18 Jan 2015 20:55:47 +0100 Subject: [PATCH] Improve query to the google maps geocoding api --- analyze.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/analyze.py b/analyze.py index e3a3fe1..6a6e3b3 100644 --- a/analyze.py +++ b/analyze.py @@ -58,9 +58,9 @@ def improve_potential_places(pos_tuples): for tuple in tuple_list: index += 1 - # exclude articles ("the", "a"), they only introduce noise, but - # keep the list as a whole - if tuple[1] == "ART": + # exclude articles ("the", "a") beginning the phrase, they only + # introduce noise, but keep the list as a whole + if tuple[1] == "ART" and index == 0: continue # if we have numbers in the middle of our phrase, probably the @@ -104,8 +104,9 @@ def get_geoloc(query): } params = { - "address": query, - "components": "country:DE|administrative_area:Berlin", + "address": query + ", Berlin", + "bounds": "52.6754542,13.7611176|52.33962959999999,13.0891553", + "components": "country:DE", "sensor": False }