Sanitizing location data

僤鯓⒐⒋嵵緔 提交于 2019-12-11 09:30:04

问题


I have a database of city names, but the problem is that it is not sanitized. For example, if Bangalore, India is a city then I might have the following locations in my database:

  1. Bangalore
  2. Bangalore, India
  3. Bangulore, India (misspelled)
  4. Bangalore,top city, India
  5. Bangalore, metropolitan, india

Now I would like to sanitize this data so that the only entry that remains after the sanitation is "Bangalore, India". I could use the data that LinkedIn or Facebook has, but I don't know if this is possible or not? Another approach could be to have a master list of city names and sanitize based on that, but this seems like a costly approach. Ideally, I'm looking for a service that would return the best matched city from a correct data set, when I'm passing any city name (correct or incorrect) as input. Any pointers would be appreciated.

来源:https://stackoverflow.com/questions/13681133/sanitizing-location-data

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!