Percentage matching of text

Guus2005

AWF VIP
Local time
Today, 07:32
Joined
Jun 26, 2007
Messages
2,642
Hi,

I need an algorithm that produces the results of a text comparison as
a percentage-match.

does anyone know of an algorithm or library that would do this?

thanks in advance.

Guus
 
Are we talking about comparing the following

Single words
long text strings
short text strings
repeating words

more info needed
 
soundex method noted above is a good way of effectively "pattern matching" strings
 
Are we talking about comparing the following

Single words
long text strings
short text strings
repeating words

more info needed
Dave,

All of the above.

I believe the Soundex method might work. I have to look into it.

Thanks for all the responses. :D
 
There is a long answer to this but briefly you have two sets of text of variying length. Now it depends if you are only comparing A with B or A with B and B with A.

First step is to create 2 dynamic arrays using Split(TextA," ") and Split(TextB," ")

then comparing A to B

Use a For X = 1 to UBound(ArrayA)
If Instr(TextB,ArrayA(x) <> "" then
Word in A exists in B
Cnt = Cnt +1
End If

So you take each word in turn from ArrayA and test to see i it exists in TextB
Then repeat reversing the strings

The Ubound(A) will give you then number of words so using that you can calculate the % in each

If I get chance I will drat up an Example for you.
 

Users who are viewing this thread

Back
Top Bottom