SocialHarvest / geobed

A simple, lightweight, embedded geocoder for Golang with city level accuracy
BSD 3-Clause "New" or "Revised" License
72 stars 25 forks source link

New York/New York, NY/New York City, NY/New York City, NY, USA all instead return New York Mills, NY location data #8

Open umpc opened 8 years ago

umpc commented 8 years ago

First of all, thanks for writing this. I haven't found another similar approach to this for geocoding.

Most locations work great. Perhaps at this point there's not a good way of handling this, but because of how you mentioned "New York, NY" in the docs, I decided that this was worth opening.

tmaiaroto commented 8 years ago

Yea, I'm going to change how the matching is done. It's just using a best match based on the string being tokenized. It adds the parts matched for a score. But I'm leaning more towards exact matches. Just for this case. I may still or once also would match "New York" with the highest populated city named New York. Assuming one meant the "obvious" choice.

I just haven't had the time to look into it again, but I will.

umpc commented 8 years ago

Ahh, I see. Interesting. It would be neat to see what you come up with. I might have to take a crack at it before too long and issue a PR if it helps noticeably. Thanks for at least considering this fix!

On Feb 20, 2016, at 12:23 PM, Tom Maiaroto notifications@github.com wrote:

Yea, I'm going to change how the matching is done. It's just using a best match based on the string being tokenized. It adds the parts matched for a score. But I'm leaning more towards exact matches. Just for this case. I may still or once also would match "New York" with the highest populated city named New York. Assuming one meant the "obvious" choice.

I just haven't had the time to look into it again, but I will.

— Reply to this email directly or view it on GitHub.