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

Re: Smart Comparison of Buffy Strings

by drinkd (Pilgrim)
on Feb 03, 2002 at 13:50 UTC ( [id://143056]=note: print w/replies, xml ) Need Help??


in reply to Smart Comparison of Buffy Strings

I like the soundex approach, but it seemed to me that a XOR of the strings is the more elegant way, then look for a series of 1's longer than some threshold.

A Super Search came back with This very similar thread, except searching a whole database for such sorta-matches. Sure enough, the consensus winner was This XOR solution from japhy, although there were many other good sugestions.

drinkd

Replies are listed 'Best First'.
Re: Re: Smart Comparison of Buffy Strings
by hossman (Prior) on Feb 03, 2002 at 23:12 UTC
    In the node you cite, the goal was to ensure that two strings are "differnet enough". In this node, the goal is to determine if two nodes are "similar enough"

    That's an important distinction.

    japhy's solution considers two strings different if their lengths are significantly different. I'm fairly certain that's not what Cody wants. If one quote is a complete subset, or a complete superset of another, with only an few subtle spelling mistakes, it should still be considered "similar enough". I would definitely go with String::Approx and set the 'I' and 'D' modifiers very high to allow a large number of Inserts and Deletes (and of course: the 'i' modifier for case insensativeity). You'll have to really play with the "approximateness percentage" to ensure that it allows enough subtle word spelling differences, but doesn't complain that every quote that uses the word "the" is the same.

    And of course: I wouldn't recomend this to flat out reject any quote, just to flag it as a potential duplicate.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2024-04-16 18:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found