<--!?php global $ec3; $ec3->nocss=true; ?-->
Preloader Preloader 2

Complement victory rateюhow exactly to Compute the similarity between two words/strings.

Complement victory rateюhow exactly to Compute the similarity between two words/strings.

The string similarity formula was created to meet here criteria:

  • A genuine expression of lexical similarity – strings with smaller distinctions should really be recognized as getting close. Particularly, an important sub-string overlap should point to a higher standard of similarity between the chain.
  • A robustness to variations of term purchase- two strings that have the same phrase, in another order, need recognized as becoming similar. Having said that, if one sequence is merely a random anagram from the characters included in the various other, it should (usually) end up being thought to be dissimilar.
  • Language independence – the algorithm should operate not only in English, and in several languages.

Solution

The similarity is computed in three strategies:

  • Partition each string into a list of tokens.
  • Processing the similarity between tokens through the help of a string edit-distance formula (extension element: semantic similarity dimension by using the WordNet library).
  • Processing the similarity between two token records.

Discover another topic for your guide.

A better similarity score algorithm for changeable size strings

Thanks all for your support and pointers.

Martin Xie [MSFT] MSDN society Support | Feedback to united states Get or Request rule test from Microsoft Please make sure to mark the responses as responses if they let and unmark them should they render no support.

  • Marked as response by Martin_Xie Monday, Sep 26, 2011 8:48 was

All responses

What’s your query,explain it a bit more particular,i had gotten confused with our

By way of example „a_logfile.txt“ and „logfile_a.txt“ should always be really similiar and aswell „loga_file.txt“ and „logfile.text“ yet not „myText.txt“ and „logfile.txt“

If this solved your condition,Please mouse click „Mark As response“ thereon post and „tag as Helpful“. Pleased Programming!

Okay we test it once again :)

Better i want to evaluate filenames and that I need to get a share quantity in exactly how similiar these include. I do not know if this is exactly feasible anyway.

As an instance a filename „a_filename.txt“ and „filename_a.txt“ is really similiar for all of us but exactly how am I able to get the exact same lead programmatically.

Another instance filename „file_abc_.txt“ and fil_abc_e.txt“ can similiar but again how can i have the benefit programmaticaly

That’s perhaps more difficult than it seems at first.

Take a good look at http://en.wikipedia.org/wiki/String_metrics and heed many of the website links.

Concerns David Roentgen Every regimen sooner or later becomes rococo, immediately after which rubble. – Alan Perlis the only real legitimate measurement of signal high quality: WTFs/minute.

This is MSDN Community Forum.

This short article shows a good solution about: Ideas on how to calculate the similarity between two words/strings. The formula originated in C# and escort girl Charlotte you may download the demonstration internally.

The string similarity algorithm originated in order to meet these requisite:

  • A genuine expression of lexical similarity – strings with lightweight variations should always be thought to be are close. Particularly, a significant sub-string overlap should indicate a top standard of similarity between the chain.
  • A robustness to modifications of word purchase- two chain which contain equivalent phrase, in another type of order, ought to be recognized as getting close. Alternatively, if an individual string is a random anagram of this characters within the various other, this may be should (usually) getting thought to be dissimilar.
  • Words independence – the formula should work not only in English, but also in a variety of languages.

Answer

The similarity are computed in three tips:

  • Partition each string into a summary of tokens.
  • Processing the similarity between tokens simply by using a string edit-distance algorithm (expansion function: semantic similarity dimension with the WordNet collection).
  • Processing the similarity between two token databases.

There was another topic for the guide.

An improved similarity positioning algorithm for variable length chain

Many thanks all to suit your assistance and tips.

Martin Xie [MSFT] MSDN Community Support | Feedback to united states Get or consult signal Sample from Microsoft Please take the time to draw the replies as responses when they help and unmark all of them when they offer no help.

  • Marked as response by Martin_Xie Monday, September 26, 2011 8:48 AM

I have written a laws for my venture to discover similar labels more or less from database.

first we made use of the DIFFERENCE(string1, string2)>=4 function of SQL host it failed to help me because for example whenever first-name is „21“ and second label was „21 hop street“ the result contained two brands whereas certainly they don’t even close. so the result group of this type of a query contained over 700 beliefs that was very poor in this situation.

I then located a comparable IMPROVEMENT features for c# that has been nearly exactly like SQL version of that purpose. as an example it matched the similarity of „asdcdfsdfgdsgdg“ and „asdewwetqwetrwe“ as best which obviously untrue.

then I developed a category with this problem to obtain more efficient similarity between chain.

the name of the course are StringCompare and listed here is an introduction to this course:

UNDERSTANDING STRING COMPARE?

StringCompare are a contrasting software for strings. Not an ordinal contrast, but a member of family contrast that find just how much two chain become close or how much not close.

By placing the good tradeoff values you can aquire an excellent comparison for chain.

HOW TO USE:

First you ought to create an example of StringCompare with tradeoff values or default tradeoff principles.

Discover 4 prices that can be set:

1. MinSimilarityLong:

This is basically the minimal acceptable amount of similarity between two strings that researching with StringCompare. This advantages is used for strings making use of duration of no less than 8.

2. MinSimilarityShort:

Here is the lowest acceptable amount of similarity between two chain that comparing with StringCompare. This benefits can be used for chain because of the size below 8.

3. MaxToleranceLong:

Here is the max acceptable portion of tolerance between two chain that contrasting with StringCompare. This worth can be used for strings with all the period of at least 8.

4. MaxToleranceShort:

This is the optimum appropriate portion of tolerance between two strings that evaluating with StringCompare. This importance is used for strings aided by the duration below 8.

* After you’ve developed a case it is possible to call InstanceName.IsEqual (string1, string2) to discover the equivalence of two strings.

* think about the equality try relative to the minSimilarty and maxTolerance your put prior to.

* give consideration to that larger minSimilarity values will result in a lot more restricted information and the other way around.

* Consider that reduced maxTolerance prices can lead to considerably limited outcome and vice versa.

Like: