On Thu, Feb 19, 2009 at 12:13 PM, Evan Ruff
<evan...@hendersonsawmill.com> wrote:
Hello!
I'm currently using your JGeocoder Library to do address parsing in my application. It works great and has really helped me out, thanks for writing it! I've begun to implement it in some free form address boxes to parse out the various parts. There are a couple of address formats that seem to throw NPEs when calling it. I was wondering if you could tell me what I'm doing wrong? Here's the code that I'm using to call it:
Map<AddressComponent, String> parsedAddr = AddressStandardizer.normalizeParsedAddress( AddressParser.parseAddress( theAddress ) );
On most addresses it work great, but here are some examples that I've found that throw the NPE:
754 Juniper St NE
#1
Atlanta, GA 30308-1310
United States of America
the code will not parse input that has anything text after the zip code, you may just need to remove them before you send it for parsing
754 Juniper Street NE
Unit #1
Atlanta, GA 30308 (This seems to break on the # sign)
i think you are right, it can only parse 'unit <number>' and '# number'
The White House
1600 Pennsyvania Ave, NW
Washington, DC 20500 (Return incomplete information)
this is because of the comma before 'NW', the parser may have taken 'NW' as the address line 2
1600 Pennsyvania Ave, NW
The White House
Washington, DC 20500 (incomplete)
same issue as above, 'NW, The White House' is probably now address line 2
So, I guess if there's that additional information in there it breaks the algorithm. Also, what's the appropriate way to handle the Country information?
Thanks for all your help!
Evan