Skip to content

Parsing street addresses in a java application

I recently had to find a way to parse a street address into its component parts, and thought I’d share my adventure.

The idea is to take a string like “123 S Main Street” and break it apart into the street number (123), the street direction (S), the street name (Main) and the street type (Street).

At first, I thought that regular expressions would work, but the sheer variety of legal postal street addresses quickly dissuaded me, as did my boss’s misgivings.

Stackoverflow has a nice discussion of the problem, which gave me some additional pointers.  There’s a commercial solution, which is available as a COM component or a web service–I didn’t try this.  There is a free, but application/attribution required, web service provided by a university that did a great job (thanks, California tax payers).  This solution is also available in a for-pay variant.

Neither of these were desirable because we needed to parse a lot of addresses quickly, and calling out over the web can be slow.  Some more digging turned up this stack question and  JGeocoder, which has a fairly robust address parser.  It’s not perfect, but it was free and open source.  I am not sure if it is still in development (the author didn’t respond to my email) but it does what we need it to do.

As an added bonus, we’re using pentaho for the data processing, and you can call java classes directly from your data processing steps, so I didn’t even have to wrap the java call in a shell script or anything.

DualPhone 3088 Skype Phone: first impressions

AKA, the internet eats the phone system, installment one.

We recently bought a skype phone (having been inspired by this post).  We wanted to use our cell phones less (having been inspired by this book), and Skype seemed like an alternative to the local telco (Qwest).  Of course, it just increases our dependence on our local ISP (Comcast).  Gotta love broadband duopolies.

There was one requirement that made the phone relatively easy to choose.

  • It had to work without a computer being on.  I didn’t want to have to tie up a laptop or netbook for this phone.

This criteria limits you to about three phone models.  There are tons of phones that work as long as they are plugged into a computer (and they are cheaper too).  After spending some time wandering through Amazon.com’s catalog (a local store was also called, and they didn’t have anything), we selected the DualPhone 3088.  Here’s the Amazon page.

Impressions from using this phone for about a month.

  • It was easy to set up–I just created another skype account and set it up for some subscriptions.
  • The phone service is pretty good, though it has cut out a couple of times in use.  Of course, having AT&T as a cell phone provider, this is something we’re used to.
  • The phone feels cheap.  The handset is light and not quite full sized.

The economics are powerful, though.  A full subscription to skype (Skype In, so that others can call us, and Skype Out, so that we can call regular phone numbers) is around 9 bucks a month.  As we cut back our cell phone minutes, we’ll see whether a Skype phone is a full blown solution.