newbie question: parsing street name from address
kevin.bell at slcgov.com
Thu Jun 21 17:20:52 CEST 2007
Look at the string.split() built-in, then you could use s.isalpha &
s.isdigit to test each word... regular expressions would be the way to
go, but that's a bit to chew on if you're getting started with string
methods. You'll need to look at list indexing as well.
SLC DOT GIS
From: python-list-bounces+kevin.bell=slcgov.com at python.org
[mailto:python-list-bounces+kevin.bell=slcgov.com at python.org] On Behalf
Sent: Thursday, June 21, 2007 7:47 AM
To: python-list at python.org
Subject: newbie question: parsing street name from address
I am working on a project that requires geocoding, and have written a
very simple geocoder that uses the Google service.
I would like to be able to extract the name of the street from the
addresses in my data, however they vary significantly. Here a some
25 Main St
2500 14th St
12 Bennet Pkwy
Bennet Rd and Main st
As you can see, sometimes I have the house number, and sometimes I do
not. Sometimes the street name is a number. Sometimes I simply have
the names of intersecting streets.
I would like to be able to parse the above into the following:
How might I approach this complex parsing problem?
More information about the Python-list