Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

compare strings

Status
Not open for further replies.

abdellatif99

Programmer
Jun 26, 2002
11
LY
i have two strings:

x='my interesting is reading'
y='my interesting is develpoer'

OR

x= 'Break light doesn't work'
y= 'Front light doesn't work'

i would like to calculate the degree of similarity between them.


 
How exactly do you define your 'degree of similarity ?

You could do a word for word compare. Check if every single word in the first string is present in the second and base a percentage of similarity on the number of words of the first in the second string. But then again, what is a word ?

As one of my mentors once said:
Defining the functionality to the details, often solves you technical solutions faster.

HTH,
Weedz (Edward W.F. Veld)
My private project:Download the CrownBase source code !!
 
While you can start with VFP's built-in functions SOUNDEX() and DIFFERENCE(), these are normally only used on "words" not strings. As Weedz suggests, once you decide on an algorithm, then perhaps we can help you "optimize" the FP code.

Rick
 
You might take a look at PhDbase a third party addon that does 'fuzzy' comparison/searches. I found a number of hits for this on the web.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top