Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jchristn/stringsimilarity
Simple US-English String Similarity Score Calculator
https://github.com/jchristn/stringsimilarity
comparison nuget score scoring similar similarity string
Last synced: about 2 months ago
JSON representation
Simple US-English String Similarity Score Calculator
- Host: GitHub
- URL: https://github.com/jchristn/stringsimilarity
- Owner: jchristn
- License: mit
- Created: 2017-11-09T00:29:36.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2021-11-12T18:14:32.000Z (about 3 years ago)
- Last Synced: 2024-11-10T02:14:10.278Z (3 months ago)
- Topics: comparison, nuget, score, scoring, similar, similarity, string
- Language: C#
- Size: 561 KB
- Stars: 10
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE.TXT
Awesome Lists containing this project
README
# StringSimilarity
This class library calculates a score from 0 to 1 based on the similarity of two supplied strings.
Effective v1.0.1, StringSimilarity is now targeted to both .NET Core 2.0 and .NET Framework 4.5.2.
[![][nuget-img]][nuget]
[nuget]: https://www.nuget.org/packages/StringSimilarity
[nuget-img]: https://badge.fury.io/nu/Object.svg
## Help or FeedbackFirst things first - do you need help or have feedback? Contact me at joel dot christner at gmail dot com or file an issue here!
## New in v1.0.1
- Retarget to .NET Core 2.0 and .NET Framework 4.5.2
## Score Computation- If one string is null/empty and the other is not, the score is 0
- If both strings are null/empty, the score is 1
- Otherwise, a length score is multiplied by a character match score, where length score = (min / max) and character match score is (num matching / total)## Example
Refer to the Test project for an example.
```csharp
using Similarity;Console.Write("String 1 : ");
string str1 = Console.ReadLine();
Console.Write("String 2 : ");
string str2 = Console.ReadLine();
Console.WriteLine("Score : " + StringSimilarity.Calculate(str1, str2));
```
## Version HistoryNotes from previous versions (starting with v1.0.0) will be moved here.
v1.0.0
- First release