matching a street address with regular expressions

Paul McGuire ptmcg at austin.rr.com
Fri Oct 12 08:36:38 EDT 2007


On Oct 12, 1:07 am, Paul McGuire <pt... at austin.rr.com> wrote:
> On Oct 11, 11:50 pm, John Nagle <na... at animats.com> wrote:
>
>
>
> >     If anyone has a first-rate address parser in Python that will cover
> > most of the developed world, I'd like to talk to them.
>
> >                                 John Nagle
> >                                 SiteTruth
>
> The pyparsing examples page includes a street address parser (http://
> pyparsing.wikispaces.com/space/showimage/streetAddressParser.py) that
> will handle these test cases:
>
>     100 South Street
>     123 Main
>     221B Baker Street
>     10 Downing St
>     1600 Pennsylvania Ave
>     33 1/2 W 42nd St.
>     454 N 38 1/2
>     21A Deer Run Drive
>     256K Memory Lane
>     12-1/2 Lincoln
>     23N W Loop South
>     23 N W Loop South
>     25 Main St
>     2500 14th St
>     12 Bennet Pkwy
>     Pearl St
>     Bennet Rd and Main St
>     19th St
>
> -- Paul

Here are the results from parsing 3120 De la Cruz Boulevard:

['3120', 'De la Cruz', 'Boulevard']
- name: De la Cruz
- number: 3120
- street: ['3120', 'De la Cruz', 'Boulevard']
  - name: De la Cruz
  - number: 3120
  - type: Boulevard
- type: Boulevard

-- Paul




More information about the Python-list mailing list