https://github.com/soenneker/soenneker.utils.string.jaccardsimilarity
A utility library for comparing strings via the Jaccard similarity algorithm
https://github.com/soenneker/soenneker.utils.string.jaccardsimilarity
comparison csharp dotnet fuzzy jaccard jaccardsimilarity jaccardsimilaritystringutil matching similarity string utils vector
Last synced: 3 months ago
JSON representation
A utility library for comparing strings via the Jaccard similarity algorithm
- Host: GitHub
- URL: https://github.com/soenneker/soenneker.utils.string.jaccardsimilarity
- Owner: soenneker
- License: mit
- Created: 2023-12-31T18:52:48.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2026-04-15T14:11:17.000Z (3 months ago)
- Last Synced: 2026-04-19T20:11:07.933Z (3 months ago)
- Topics: comparison, csharp, dotnet, fuzzy, jaccard, jaccardsimilarity, jaccardsimilaritystringutil, matching, similarity, string, utils, vector
- Language: C#
- Homepage: https://soenneker.com
- Size: 1.37 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
- Security: .github/SECURITY.md
Awesome Lists containing this project
README
[](https://www.nuget.org/packages/soenneker.utils.string.jaccardsimilarity/)
[](https://github.com/soenneker/soenneker.utils.string.jaccardsimilarity/actions/workflows/publish-package.yml)
[](https://www.nuget.org/packages/soenneker.utils.string.jaccardsimilarity/)
[](https://github.com/soenneker/soenneker.utils.string.jaccardsimilarity/actions/workflows/codeql.yml)
#  Soenneker.Utils.String.JaccardSimilarity
### A utility library for comparing strings via the Jaccard similarity algorithm
## Installation
```
dotnet add package Soenneker.Utils.String.JaccardSimilarity
```
## Why?
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:
### Set-Focused:
It works well when you care about what elements are present, not their order.
### Scale Doesn't Matter:
It's not influenced by how big the sets are, just by what they share.
### Efficient:
It's quick to calculate making it suitable for large datasets.
### Handles Noise Well:
It stays reliable even if there's extra, less important information in the sets.
## Usage
```csharp
var text1 = "This is a test";
var text2 = "This is another test";
double result = JaccardSimilarityStringUtil.CalculateSimilarityPercentage(text1, text2); // 60
```