Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to predict correct country name for user provided country name?

I am planning to do some data tuning on my data.

Situation-I have a data which has a field country. It contains user input country names( It might contain spelling mistakes or different country names for same country like US/U.S.A/United States for USA). I have a list of correct country names.

What I want- To predict which closest country it is referring to. For example- If U.S. is given then it will change to USA(correct country name in our list).

Is there any way I can do it using Java or opennlp or any other method?

like image 625
AngryLeo Avatar asked Jan 27 '16 06:01

AngryLeo


People also ask

How do countries decide their name?

Common Themes. There's a fascinating trend in country names – countries are almost always named after one of four things: a directional description of the country, a feature of the land, a tribe name or an important person, usually male.


2 Answers

You can use Getty API . It will give you abbreviations of country name. Just play on this API.

OR

You can also use Levenshtein Distance to get most closest country name.

Try this out. Will help you.

like image 185
iNikkz Avatar answered Sep 24 '22 10:09

iNikkz


You can try Google's auto complete location api to your text box or select. if you will use this api then you will get google like auto complete intellisence while typing. visit link

like image 20
Nitin Dhomse Avatar answered Sep 23 '22 10:09

Nitin Dhomse