Does anyone have a recommended pseudo-algorithm for, given a string containing an address:
Bre开发者_开发百科ak apart the address apart into a Street variable, a City variable, a State variable, and a Zip variable
The address string may be formatted in a number of different ways. For example, it may be comma separated or it may be separated by spaces. Also, the address may only contain a city and state, and not a street address or zip code. Similarly, it may contain a street, city, state, and not a zip code.
To make things harder, I cannot use regular expressions (as I am developing on a mobile platform that does not support it).
Thanks!
No, but look at JGeocoder:
http://jgeocoder.sourceforge.net/parser.html
They split addresses up into their constituent parts. You could take a look at the source for that...
Here is a cool solution using Google Maps provided by John. May be you want to use that :
Java postal address parser
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论