Re: String Comparison

  • From: "Bill Gallik" <billgallik@xxxxxxxxxxxxxx>
  • To: <programmingblind@xxxxxxxxxxxxx>
  • Date: Tue, 12 Apr 2011 00:26:03 -0500

Ok, what programming language are you using for this?

Also, this is a very open-ended question because you haven't specified any properties to be compared. For instance, if one string is 10 characters long and the other is a half MB then what could the two possibly have in common -- wouldn't this return a 0% similarity?

If I were writing such a function, I would design it such that:

1)  are the two strings identical -- if so, return a 100%

2) if the only difference between the two strings is that some characters are upper case and the same lower case letter occupies the identical slot in the second string the function would return a +90% value.

From there, progressively lower similar per centages would be returned depending on the requirements of the program.
----
Holland's Person, Bill
   E-Mail: BillGallik@xxxxxxxxxxxxxx
- "Evil indeed is the man who has not one woman to mourn him."
- Sir Arthur Conan Doyle; -- Watson, on the death of Selden in "The Hound of the Baskervilles"
__________
View the list's information and change your settings at //www.freelists.org/list/programmingblind

Other related posts: