Python Forum

Full Version: naming entities(city abbreviations)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
is there any readymade code for identifying the city name abbreviation??

i have a task which contains P.O Box 1442 Hyderabad .i have to extract city part bot will comme to know if it is "hyderabad" . some times we get string as P.O Box 1442 Hyd /P.O Box 1442 Hydera/P.O Box 1442 Hbd. so how bot will identifies the naming entities??
the city name is keep on changing. i have attached the script also. is it correct or i need more to be added.
Difficult. I was going to point you to an airport list but your examples suggest it may be impossible - hyd could be Hyderabad, or could by Hyden Ky in the US. If you can limit to a single country you will have a better chance, but I don't think there is a source for a dictionary of all the possible ways people will shorten the name.