Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Approximate matching of company names

by toma (Vicar)
on Oct 18, 2003 at 05:56 UTC ( [id://300239]=note: print w/replies, xml ) Need Help??


in reply to Some kind of fuzzy logic.

I have been able to make this work with String::Approx. I had to match one list of companies against another. The lists were made by different organizations.

First, it helps to strip the noise from the company names, such as Inc, Co, Corp, GMBH, LTD, etc.

String::Approx finds a distance by looking at insertions, deletions, and substitutions needed to transform one string to another.

A different approach, which worked better for me, was to make lists of all the substrings of length n in the source string. I called these n-tuples. I compared the percentage overlap between the n-tuple sets for each name in one list to the n-tuples for each word in the other list. The best value for the length n of the tuples was three or four.

Very close matches could be completely automated this way. For matches that were not so close, I finished the matching task manually. I made a web user interface that had a selection list of the match candidates ranked by the closeness of the match. The closeness was determined by the percentage of n-tuples that matched. I selected the best match for each entry on the amongst these top-ranked match candidates.

It should work perfectly the first time! - toma

Replies are listed 'Best First'.
Re: Approximate matching of company names
by the_0ne (Pilgrim) on Oct 19, 2003 at 18:36 UTC
    A different approach, which worked better for me, was to make lists of all the substrings of length n in the source string. I called these n-tuples. I compared the percentage overlap between the n-tuple sets for each name in one list to the n-tuples for each word in the other list. The best value for the length n of the tuples was three or four.

    Toma, could you give me an example of what you mean by this paragraph? I don't want you to go to the trouble of code examples, I mean an example using text so I can better understand what you mean.

    Thanks...
      Here is the requested example that shows how n-tuples work:

      In this example, take n=3. The company names to compare are "tomacorp" and "tomarcorp". The 3-tuples of tomacorp are:

      tom oma mac aco cor orp
      The 3-tuples of tomarcorp are:
      tom oma mar arc rco cor orp
      The tuples in common are:
      tom oma cor orp
      Four of the six 3-tuples in tomacorp appear in tomarcorp. This is a 75% match.

      It should work perfectly the first time! - toma
        Is there a perl module or modules that implement this approach?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://300239]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2024-04-24 12:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found