Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
You are attempted to do something that is very hard to do in a general sense. Human beings just input the most amazing things! As a thought for you, I have one app that translates a bunch of aliases into "the standard term". Its not fancy or elegant, but after going through a few million records over the years, I've got a pretty stable DB for this specific application.

input DB is like:

Program generates a hash translation table and makes sure that no variant is also a "standard term". A human guides entries into this table, eg is this "close enough" to the "standard term" that it should be recognized as equivalent. I suspect that some amount of human guidance will be needed in your app also. A "translation table" as opposed to regex substitution can work well for something like translate, "state" into standard 2 letter US Postal code. Eg for TX:TX,Texas,Tex,Texass or whatever! Over time, the DB would evolve into a very high probability of translating correctly something that a human would recognize as "Texas". There will be some limit of the algorithm, no matter how "smart" it is and consider a "look-up" to do a lot of the "heavy lifting".

I haven't researched this, but the US Postal Service is one if not the top service in the world in terms of automated sorting. Whatever these folks are using, it works pretty well and there probably are some public domain papers out there describing algorithms and methods that they use.

In reply to Re: Suggestions requested: module to standardize postal address components? by Marshall
in thread Suggestions requested: module to standardize postal address components? by atcroft

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    and all is quiet...

    How do I use this? | Other CB clients
    Other Users?
    Others meditating upon the Monastery: (5)
    As of 2018-08-14 13:45 GMT
    Find Nodes?
      Voting Booth?
      Asked to put a square peg in a round hole, I would:

      Results (150 votes). Check out past polls.