[polygons/osm] Adding a unified neighborhood reverse geocoder incorporating Zetashapes, OSM and Quattroshapes. Uses the new Soft TFIDF implementation to approximately match OSM names to Quattroshapes/Zetashapes names and geohash indices for more coarse point-in-polygon tests (OSM neighborhoods are stored as points not polygons, so need to match with a geometry from the other sources)

This commit is contained in:
Al
2015-10-31 14:15:39 -04:00
parent a38624ba59
commit 3e43ac7255
3 changed files with 434 additions and 58 deletions

View File

@@ -70,7 +70,7 @@ class NameDeduper(object):
tokens2 = cls.content_tokens(s2)
if not cls.possible_match(tokens1, tokens2):
return max(cls.dupe_threshold - 0.1, 0.0)
return 0.0
tokens1_only = [t for t, c in tokens1]
tokens2_only = [t for t, c in tokens2]
@@ -87,7 +87,7 @@ class NameDeduper(object):
tokens2 = cls.content_tokens(s2)
if not cls.possible_match(tokens1, tokens2):
return max(cls.dupe_threshold - 0.1, 0.0)
return 0.0
tokens1_only = [t for t, c in tokens1]
tokens2_only = [t for t, c in tokens2]