|
In a message dated 4/10/2006 3:43:25 P.M. Eastern Standard Time,
[EMAIL PROTECTED] writes:
> William,
> > Thanks for the code. This approach is new to me and very interesting. > > I am trying to work with > “2418 23rd, 3/1/cp Storage, $675/mo+Bills, $500/dep, 1500sf, Great Deal! 806-632-4037” > and I get “Number found where operator expected…line 100, near 23” > “(Missing operator before 23?)” > “Bare word found where operator expected… line 100 near 23rd” > “(Missing operator before rd?)” > “Bare word where operator expected… line 100 near 1500sf” > “(Missing operator before sf?)” > “Can’t modify constant item post decrement ß> at line 98 near “begins –“ > > I changed: > > my $st_ordinal = qr( \s+ \d+ (?: st | nd | rd | th | pl )? )ix; > > to > > my $st_ordinal = qr( \s+ \d\d+ (?: st | nd | rd | th | pl )? )ix; > ^^ > With the same results. > Not sure why it is not working? > How not to see “1500sf”? > > Jerry hi jerry --
i think i see what has happened. i intended the code and the
test data to go into two
separate files, but it seems you have put everything into the same
file. sorry i
was not more clear about this. i intended the test code to be
invoked like this:
perl test_code.pl test_data.dat
if the code and data are placed in separate files, the perl code will open
the
data file and process the data line by line, with each line being a
listing.
as to the change to the $st_ordinal regex object definition,
the change you
propose will prevent a street address like ``1234 2nd st.'' from being seen
as
such, since there would have to be two decimal digits in any such
ordinal,
e.g., ``22nd st.''. (of course, this may be completely
appropriate to your city,
you may simply not have any streets names like ``1st ave.'' or ``2nd
st.'', etc.)
also, i don't understand the addition of the ``pl'' ordinal suffix: can one
have
a number like ``23pl''?
anyway, try breaking out the code and data into two files; i think it'll
work
a lot better. as before, i'll be interested to hear how this
works for you.
hth -- bill walters
|
_______________________________________________ ActivePerl mailing list [email protected] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
