dotnet add package Soenneker.Utils.String.JaccardSimilarity
Jaccard similarity is great for comparing sets of items, and it's often used for tasks like detecting similar documents or recommending content. It's useful because:
It works well when you care about what elements are present, not their order.
It's not influenced by how big the sets are, just by what they share.
It's quick to calculate making it suitable for large datasets.
It stays reliable even if there's extra, less important information in the sets.
var text1 = "This is a test";
var text2 = "This is another test";
double result = JaccardSimilarityStringUtil.CalculateSimilarityPercentage(text1, text2); // 60