Percentage Likeness between strings

T

Travis

Is there a way to determine the percentage likeness two strings share?
So that given an parameter string1 and a list of strings to search, I
could display only those values that are say, a 75% or more match?
 
V

Victor Bazarov

Travis said:
Is there a way to determine the percentage likeness two strings share?

Depending on your definition of "likeness", I am sure there is.
So that given an parameter string1 and a list of strings to search, I
could display only those values that are say, a 75% or more match?

What does that mean for them to be N% match? Please post your algorithm
if you have it, and we'll help you convert to C++. If you don't have
the algorithm, post to comp.programming.

V
 
P

Phil Endecott

Travis said:
Is there a way to determine the percentage likeness two strings share?
So that given an parameter string1 and a list of strings to search, I
could display only those values that are say, a 75% or more match?

If you want a C++ implementation of an edit-distance algorithm, there's
one that I wrote here:

http://svn.chezphil.org/anyterm/trunk/common/diff.cc (and .hh)

It's GPL licensed. But you might find the comments useful, even if you
can't directly use the code.

If you want a fast method for ranking search results for a human, this
may not be what you want. But it will probably point you in the right
direction.


Phil.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,184
Messages
2,570,976
Members
47,536
Latest member
MistyLough

Latest Threads

Top