I am writing a program which take a string of address and break it down into city, country etc. Let say someone speak New York City U.S. or U.S. New York after decoupled they both be country = U.S. and city = New York City.
Asked
Active
Viewed 91 times
-1
-
Will the address string always be in a consistent format? Show us some sample data. – JamesFaix Mar 14 '17 at 22:10
-
No, coz it's from speech to text. Let say "what is the weather like UK London or London UK". Really depend on the person who have spoken. – LittleFunny Mar 14 '17 at 22:17
-
2You should provide a code example of what you have tried.This isn't how this website works. – Dec Mar 14 '17 at 22:27
-
@LittleFunny try to experiment with google API: https://developers.google.com/maps/documentation/geocoding/intro – MistyK Mar 14 '17 at 22:54
1 Answers
0
You'd need
- A special format for cities / countries to identify them
- Or a database (Or some lists with the data) to compare the different solutions, which develop by using other values from the city than the intended city, wether they suite the data.
There sadly is no magic method which returns you the string splitted into country and city.

MetaColon
- 2,895
- 3
- 16
- 38