Azimzada.StringSimilarity 1.0.3

dotnet add package Azimzada.StringSimilarity --version 1.0.3
                    
NuGet\Install-Package Azimzada.StringSimilarity -Version 1.0.3
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Azimzada.StringSimilarity" Version="1.0.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Azimzada.StringSimilarity" Version="1.0.3" />
                    
Directory.Packages.props
<PackageReference Include="Azimzada.StringSimilarity" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Azimzada.StringSimilarity --version 1.0.3
                    
#r "nuget: Azimzada.StringSimilarity, 1.0.3"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Azimzada.StringSimilarity@1.0.3
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Azimzada.StringSimilarity&version=1.0.3
                    
Install as a Cake Addin
#tool nuget:?package=Azimzada.StringSimilarity&version=1.0.3
                    
Install as a Cake Tool

Azimzada.StringSimilarity

A powerful .NET library for calculating string similarities and performing fuzzy searches. This library implements popular string similarity algorithms like Levenshtein Distance and Jaro-Winkler, making it perfect for tasks such as spell checking, search suggestions, and data matching.

Features

  • 🚀 Fast and efficient implementation
  • 📊 Percentage-based similarity scores (0-100%)
  • 🔍 Multiple similarity algorithms
  • 🎯 Easy to use API
  • ✨ Support for .NET 9.0+

Installation

Install via NuGet Package Manager:

Install-Package Azimzada.StringSimilarity

Or via .NET CLI:

dotnet add package Azimzada.StringSimilarity

Current version: 1.0.3

Usage

First, add the namespace to your code:

using Azimzada.StringSimilarity;

Levenshtein Distance

The Levenshtein distance measures the minimum number of single-character edits required to change one string into another. The similarity score is returned as a percentage (0-100%).

double similarity = StringSimilarity.Levenshtein("hello", "hallo");
// Returns: 80.0 (because only one character is different)

double similarity2 = StringSimilarity.Levenshtein("kitten", "sitting");
// Returns a percentage showing how similar the words are

Jaro-Winkler Similarity

The Jaro-Winkler similarity is particularly good for short strings such as person names. It returns a percentage score (0-100%).

double similarity = StringSimilarity.JaroWinkler("martha", "marhta");
// Returns: A high percentage as these are very similar

double similarity2 = StringSimilarity.JaroWinkler("dwayne", "duane");
// Returns: A good match score due to common characters

Examples

Here are some real-world examples:

// Check if user input matches a correct word
double score = StringSimilarity.Levenshtein("programming", "programing");
if (score > 90)
{
    Console.WriteLine("Did you mean 'programming'?");
}

// Compare two names
double nameMatch = StringSimilarity.JaroWinkler("John Smith", "Jon Smith");
if (nameMatch > 85)
{
    Console.WriteLine("Names are likely to refer to the same person");
}

Algorithm Details

Levenshtein Distance

  • Measures the minimum number of single-character edits needed to change one string into another
  • Handles insertions, deletions, and substitutions
  • Returns a normalized percentage score (0-100%)

Jaro-Winkler

  • Designed for short strings like names and passwords
  • Accounts for character transpositions
  • Gives more favorable ratings to strings that match from the beginning
  • Returns a percentage score (0-100%)

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contributing

Contributions are welcome! Feel free to submit issues and pull requests.

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net9.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.3 80 8/22/2025