Complement profits rateюhow-to calculate the similarity between two words/strings.
The sequence similarity formula originated in order to meet the next criteria:
- A real expression of lexical similarity – strings with small variations must certanly be recognized as are similar. Specifically, an important sub-string convergence should suggest increased level of similarity within chain.
- A robustness to adjustment of keyword purchase- two chain that have similar phrase, in another order, is seen as becoming similar. In contrast, if an individual sequence merely a random anagram of the characters contained in the some other, then it should (usually) become named dissimilar.
- Code freedom – the algorithm should work not only in English, but also in several dialects.
Option
The similarity was computed in three procedures:
- Partition each sequence into a listing of tokens.
- Computing the similarity between tokens through a sequence edit-distance algorithm (expansion element: semantic similarity description making use of the WordNet library).
- Processing the similarity between two token records.
There is another discussion for your guide.
A far better similarity position formula for variable length chain
Thanks all for your assist and suggestions.
Martin Xie [MSFT] MSDN society Support | Feedback to united states become or demand signal trial from Microsoft Kindly make every effort to draw the responses as answers should they help and unmark all of them as long as they incorporate no assist.
- Marked as answer by Martin_Xie Monday, September 26, 2011 8:48 in the morning
All replies
Something your question,explain it a bit more certain,i got confused with it
For instance “a_logfile.txt” and “logfile_a.txt” needs to be most similiar and aswell “loga_file.txt” and “logfile.text” yet not “myText.txt” and “logfile.txt”
If this resolved your problem,Please click “level As Solution” on that article and “tag as Helpful”. Happy Programming!
Ok we give it a try again 
Really I wish to compare filenames and I also need a portion numbers in just how similiar they’re. I dont determine if this will be possible whatsoever.
For-instance a filename “a_filename.txt” and “filename_a.txt” is quite similiar for all of us but exactly how should I obtain the same outcome programmatically.
Another sample filename “file_abc_.txt” and fil_abc_e.txt” can be similiar but yet again how do I have the lead programmaticaly
Which possibly more difficult than it seems at first.
Take a look at http://en.wikipedia.org/wiki/String_metrics and heed some of the website links.
Relation David R Every regimen at some point becomes rococo, following rubble. – Alan Perlis The Filipino dating app only appropriate dimension of code top quality: WTFs/minute.
Thank you for visiting MSDN Community Forum.
This information shows a good solution about: Ideas on how to calculate the similarity between two words/strings. The algorithm was developed in C# and you will install the trial inside the house.
The string similarity formula originated to satisfy these requirement:
- A real representation of lexical similarity – chain with smaller distinctions must certanly be thought to be becoming close. Specifically, a substantial sub-string convergence should indicate a higher degree of similarity between your strings.
- A robustness to variations of phrase order- two chain which contain the exact same keywords, in a special order, should be named getting close. Conversely, if one sequence is a random anagram of the characters within the various other, this may be should (usually) become recognized as dissimilar.
- Words freedom – the formula should operate not only in English, but in many different dialects.
Remedy
The similarity try computed in three procedures:
- Partition each string into a summary of tokens.
- Computing the similarity between tokens by using a string edit-distance algorithm (extension element: semantic similarity measurement by using the WordNet collection).
- Processing the similarity between two token listings.
There was another topic for the guide.
An improved similarity score algorithm for varying duration chain
Thanks all for your support and recommendations.
Martin Xie [MSFT] MSDN neighborhood service | suggestions to you become or Request laws test from Microsoft Please make the time to mark the replies as responses when they let and unmark all of them if they offer no services.
- Marked as answer by Martin_Xie Monday, Sep 26, 2011 8:48 in the morning
We have written a code for my personal task to recognize comparable labels approximately from databases.
initial we utilized the DIFFERENCE(string1, string2)>=4 purpose of SQL machine nonetheless it failed to assist me because as an example when first-name is “21” and 2nd term got “21 hop road” the effect contained two labels whereas clearly they failed to also close. so the outcome collection of these types of a query included over 700 values which was very poor in cases like this.
I quickly discovered the same VARIATION features for c# that was almost exactly like SQL type of that work. for example it matched up the similarity of “asdcdfsdfgdsgdg” and “asdewwetqwetrwe” as Great this is certainly obviously not the case.
then I created a category with this concern to obtain additional efficient similarity between chain.
title of your course is StringCompare and we have found an overview of this lessons:
UNDERSTANDING STRING EVALUATE?
StringCompare is a contrasting appliance for strings. Perhaps not an ordinal review, but a member of family comparison that identifies how much cash two chain become similar or exactly how much not comparable.
By establishing the favorable tradeoff principles you can aquire a good evaluation for chain.
THE WAY YOU USE:
Very first you should build an instance of StringCompare with tradeoff principles or standard tradeoff beliefs.
You will find 4 prices that may be put:
1. MinSimilarityLong:
This is the minimum acceptable portion of similarity between two chain that contrasting with StringCompare. This importance can be used for strings using length of at the very least 8.
2. MinSimilaritysmall:
This is actually the minimal appropriate portion of similarity between two strings that comparing with StringCompare. This worth is used for chain utilizing the duration below 8.
3. MaxToleranceLong:
Here is the optimum appropriate portion of threshold between two chain that evaluating with StringCompare. This importance can be used for strings with all the length of at the very least 8.
4. MaxToleranceShort:
This is actually the maximum appropriate amount of endurance between two chain that contrasting with StringCompare. This appreciate is utilized for chain together with the length below 8.
* Once you have developed an instance you’ll be able to name InstanceName.IsEqual (string1, string2) to look for the equality of two chain.
* think about that the equivalence is actually relative to the minSimilarty and maxTolerance your ready before.
* start thinking about that higher minSimilarity principles will result in a lot more restricted success and the other way around.
* think about that reduced maxTolerance principles will result in most constrained outcomes and the other way around.
Including: