Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #3897

Re: preg_match() oddities and question

From Sandman <mr@sandman.net>
Newsgroups comp.lang.php
Subject Re: preg_match() oddities and question
Date 2011-11-23 20:23 +0100
Message-ID <mr-B941EF.20230523112011@News.Individual.NET> (permalink)
References (3 earlier) <3004614.SPkdTlGXAF@PointedEars.de> <mr-FF0348.09552223112011@News.Individual.NET> <slrnjcpunb.85q.hellsop@nibelheim.ninehells.com> <mr-F6EC15.19011423112011@News.Individual.NET> <jajfi0$pmj$3@news.albasani.net>

Show all headers | View raw


In article <jajfi0$pmj$3@news.albasani.net>,
 The Natural Philosopher <tnp@invalid.invalid> wrote:

> >> Address-matching is a hard task. I did that for a decade professionally
> >> (as part of a job, not the sole function), and it's not easy to do well
> >> for even one postal system, and trying to write a generalized one is
> >> basically impossible to manage in one lifetime. The best *simple* way
> >> to manage it is to take a field, blow it out into individual words,
> >> standardize all the words you can find without trying to sort out
> >> what they are (which is the Very Hard part of that task), throw the
> >> alphabetic ones into soundex or nysiis, make a loose match by a chunk of
> >> postal code or city code or province, then pick the item(s) that have
> >> the greatest number of matches between incoming and loose-match record
> >> of the numeric and nysiis-encoded alphabetical elements. If you weight
> >> things like "numeric match = 1, plaintext that's in a dictionary that
> >> matches when nysiis = 2, nondictionary text that matches nysiis = 3",
> >> and do that for NAME as well as ADDRESS, you get about as good as you
> >> can get without buying someone else's work. And that's STILL a lot of
> >> effort to write. Regexp alone for address matching is a snipe-hunt. It
> >> looks obviously right and you can spend a lot of time playing with it,
> >> but it ends up being a dead end.
> > 
> > I thank you for your input, but I still maintain that my examples 
> > could be parsed by using a regular expression, and unless explicitly 
> > told so by using examples will I admit otherwise :-D
> > 
> > No offense, though.
>
> after three days, you could have done the data conversion by hand...

Huh? What data conversion? The data to be searched does not need to be 
converted into anything. It is neatly separated and also kept in a 
combined form. It's the *in-data* (i.e. the search terms provided by 
visitors to the sites). that I need to massage :)

And, three days wouldn't have gotten me far, the database contains 
over 600,000 posts of addresses :)

But, as I said, the database is neatly formatted. 



-- 
Sandman[.net]

Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

preg_match() oddities and question Sandman <mr@sandman.net> - 2011-11-22 12:21 +0100
  Re: preg_match() oddities and question The Natural Philosopher <tnp@invalid.invalid> - 2011-11-22 11:26 +0000
    Re: preg_match() oddities and question Sandman <mr@sandman.net> - 2011-11-22 12:36 +0100
    Re: preg_match() oddities and question Jerry Stuckle <jstucklex@attglobal.net> - 2011-11-22 07:22 -0500
  Re: preg_match() oddities and question tony@mountifield.org (Tony Mountifield) - 2011-11-22 11:47 +0000
    Re: preg_match() oddities and question Sandman <mr@sandman.net> - 2011-11-22 13:12 +0100
  Re: preg_match() oddities and question Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-11-22 13:30 +0100
    Re: preg_match() oddities and question Sandman <mr@sandman.net> - 2011-11-22 13:55 +0100
      Re: preg_match() oddities and question Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-11-22 17:56 +0100
        Re: preg_match() oddities and question The Natural Philosopher <tnp@invalid.invalid> - 2011-11-22 17:30 +0000
          Re: preg_match() oddities and question "Peter H. Coffin" <hellsop@ninehells.com> - 2011-11-22 17:20 -0600
            Re: preg_match() oddities and question The Natural Philosopher <tnp@invalid.invalid> - 2011-11-22 23:59 +0000
            Re: preg_match() oddities and question Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-11-23 01:59 +0100
              Re: preg_match() oddities and question Sandman <mr@sandman.net> - 2011-11-23 09:58 +0100
                Re: preg_match() oddities and question Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-11-23 22:02 +0100
                Re: preg_match() oddities and question Sandman <mr@sandman.net> - 2011-11-24 08:20 +0100
                Re: preg_match() oddities and question Denis McMahon <denismfmcmahon@gmail.com> - 2011-11-24 12:55 +0000
                Re: preg_match() oddities and question Sandman <mr@sandman.net> - 2011-11-25 09:36 +0100
                Re: preg_match() oddities and question Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-11-24 22:41 +0100
                Re: preg_match() oddities and question Sandman <mr@sandman.net> - 2011-11-25 09:26 +0100
                Re: preg_match() oddities and question Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-11-25 15:44 +0100
                Re: preg_match() oddities and question Sandman <mr@sandman.net> - 2011-11-25 16:34 +0100
                Re: preg_match() oddities and question Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-11-25 23:23 +0100
              Re: preg_match() oddities and question The Natural Philosopher <tnp@invalid.invalid> - 2011-11-23 09:35 +0000
        Re: preg_match() oddities and question Sandman <mr@sandman.net> - 2011-11-23 09:55 +0100
          Re: preg_match() oddities and question "Peter H. Coffin" <hellsop@ninehells.com> - 2011-11-23 07:53 -0600
            Re: preg_match() oddities and question Sandman <mr@sandman.net> - 2011-11-23 19:01 +0100
              Re: preg_match() oddities and question The Natural Philosopher <tnp@invalid.invalid> - 2011-11-23 18:54 +0000
                Re: preg_match() oddities and question Sandman <mr@sandman.net> - 2011-11-23 20:23 +0100
              Re: preg_match() oddities and question "Peter H. Coffin" <hellsop@ninehells.com> - 2011-11-23 12:58 -0600
                Re: preg_match() oddities and question Sandman <mr@sandman.net> - 2011-11-24 08:28 +0100
  SOLVED: Re: preg_match() oddities and question Sandman <mr@sandman.net> - 2011-11-25 10:32 +0100
    Re: SOLVED: Re: preg_match() oddities and question Jerry Stuckle <jstucklex@attglobal.net> - 2011-11-25 18:55 -0500
      Re: SOLVED: Re: preg_match() oddities and question Sandman <mr@sandman.net> - 2011-11-26 11:21 +0100

csiph-web