예제 #1
0
 def __init__(self, stamped_api, options):
     ATitleBasedEntityMatcher.__init__(self, stamped_api, options)
     earthRadius = 3959.0 # miles
     maxDistance = 20.0 / earthRadius # convert to radians
     
     self.distance = maxDistance
     self._placesDB._collection.ensure_index([("coordinates", GEO2D)])
 def getMatchingDuplicates(self, entity, candidate_entities):
     dupes = ATitleBasedEntityMatcher.getMatchingDuplicates(self, entity, candidate_entities)
     
     for dupe in dupes:
         if 'reference' in dupe:
             details = self._googlePlaces.getPlaceDetails(dupe['reference'])
             
             if details is not None:
                 if 'formatted_phone_number' in details:
                     dupe.phone = details['formatted_phone_number']
                 if 'formatted_address' in details:
                     dupe.address = details['formatted_address']
                 if 'address_components' in details:
                     dupe.address_components = details['address_components']
     
     return dupes
예제 #3
0
 def __init__(self, stamped_api, options):
     ATitleBasedEntityMatcher.__init__(self, stamped_api, options)
예제 #4
0
    def __init__(self, stamped_api, options, source):
        ATitleBasedEntityMatcher.__init__(self, stamped_api, options)

        self.source = source
 def __init__(self, stamped_api, options):
     ATitleBasedEntityMatcher.__init__(self, stamped_api, options)
     self._googlePlaces = GooglePlaces()