mohamedmansour/my-hangouts-extension — Issue #95: Normalize Users Location before Querying
Author: mohamedmansour
Created: 2012-01-17 07:13:24+00:00
State: open
Labels: Enhancement

We need to somehow normalize the location so we don't store duplicates in the internal database.

For example,

Chicago, IL | Chicago, IL, USA | 41.8781136 | -87.62979819999998
chicago, il | Chicago, IL, USA | 41.8781136 | -87.62979819999998
Chicago il | Chicago, IL, USA | 41.8781136 | -87.62979819999998

As you see, we can do simple normalization that does the following:

- Remove non word characters, we should just keep [a-zA-Z]
- Lower case the word as the location index and search on that term.

By doing that, we can eliminate a good chunk of duplicate data. More normalization could happen like, if a user just placed "Chicago" perhaps find the nearest match such as "Chicago, IL" but that might be dangerous. I believe it wont though.