I am going to look at that. but it may be more that we are looking
for. I am mainly just trying to get a converter that would convert
part of an address that has street, lane, place, suite etc and find
the correct word for the possible abbreviations.
I can do it myself using a couple of tables and a generic list. But
I would need to manually put in all the possible combinations and was
hoping there was an easier way that I could just add to my code.
You can get lists of data from the USPS and other US government
organizations. These lists of data are suitable for most uses, and can
easily be parsed into a format usable by your application. You can use
the data in one of two ways:
* Translate them into a partial class containing only the data
in the tables, or
* Translate them into an embedded database format that you deploy
with your application (probably the best) and interface with that
data file with a single class.
The latter is probably best, especially if you're likely to do things
like update the ZIP code database with a commercial one from a vendor
like zip-codes.com. You can use SQLite[1] or the built-in Windows
VFP/FoxPro database driver, though you'll probably have to generate
the database table files yourself that way (I don't think Windows'
ODBC drivers for xBase/DBF lets you create new database tables using
its API). You could even use the data files themselves, converted to
CSV, but that may lend itself to modification by end-users depending on
how technical they are(n't).
Here are some of the files that would be relevant to your effort:
Street Type Common and Standard Abbreviations
http://www.usps.com/ncsc/lookups/abbr_suffix.txt
State Abbreviations, including "Military States"
http://www.usps.com/ncsc/lookups/abbr_state.txt
ZIP code data from the US Census (CSV, w/ lat+long data),
contains ~29,500 ZIP codes, which is most of them. No
military states, either, so use with validation/confirmation
in the user interface for data retrieved from it.
http://www.census.gov/tiger/tms/gazetteer/zips.txt
This is a good start.
Note also that you can find all sorts of similar data tables and the
like on the Internet by searching Google with some uncommon
parameters. For example, I found these files with two different
queries:
USPS abbreviations filetype:txt
zip code list filetype:txt
HTH,
Mike