Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Match Algorithm: How close of a match

by zer (Deacon)
on Aug 17, 2010 at 15:34 UTC ( [id://855527]=perlquestion: print w/replies, xml ) Need Help??

zer has asked for the wisdom of the Perl Monks concerning the following question:

Good morning,

Is there anything available that I can compair two strings to determine how closely they match each other? I am thinking there should be a perl module for this but I can't seem to find any.

Alternately, I would likely program this myself. Perhaps there is an algorithm or some experience in the monestary that could point me in the right direction so I don't end up recreating the wheel.

I have text that was munged up by an application. I need to be able to crossreference that text with the original as the munged up text has changes i need to make to the original.

Thanks for all the help!

Replies are listed 'Best First'.
Re: Match Algorithm: How close of a match
by zwon (Abbot) on Aug 17, 2010 at 15:42 UTC
Re: Match Algorithm: How close of a match
by Fletch (Bishop) on Aug 17, 2010 at 15:43 UTC

    String::Approx? If that's not what you want the google fodder "Levenshtein distance" is probably a good starting point.

    The cake is a lie.
    The cake is a lie.
    The cake is a lie.

Re: Match Algorithm: How close of a match
by jethro (Monsignor) on Aug 17, 2010 at 15:50 UTC
Re: Match Algorithm: How close of a match
by planetscape (Chancellor) on Aug 17, 2010 at 18:25 UTC
Re: Match Algorithm: How close of a match
by afoken (Chancellor) on Aug 17, 2010 at 20:32 UTC

    A negated hint: Don't use soundex. At least not until you know your input fits into the very narrow scope of the soundex algorithm.

    Alexander

    --
    Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
Re: Match Algorithm: How close of a match
by Ratazong (Monsignor) on Aug 18, 2010 at 06:51 UTC

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (3)
As of 2025-05-16 18:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.