DotFuzz 1.0.0

dotnet add package DotFuzz --version 1.0.0
                    
NuGet\Install-Package DotFuzz -Version 1.0.0
                    
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="DotFuzz" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DotFuzz" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="DotFuzz" />
                    
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 DotFuzz --version 1.0.0
                    
#r "nuget: DotFuzz, 1.0.0"
                    
#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 DotFuzz@1.0.0
                    
#: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=DotFuzz&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=DotFuzz&version=1.0.0
                    
Install as a Cake Tool

DotFuzz

Language .NET SDK License

DotFuzz — a span-first, NativeAOT-friendly fuzzy string matching engine for .NET 10, with FuzzySharp-compatible scoring. The current release implements:

  • span-first Indel.Distance and Fuzz.Ratio APIs;
  • the full direct scorer family: PartialRatio, TokenSortRatio, PartialTokenSortRatio, TokenSetRatio, PartialTokenSetRatio, and WeightedRatio;
  • exact integer score cutoffs with early rejection on every scorer;
  • explicit Preprocess.Compatibility (FuzzySharp-equivalent) and Preprocess.Unicode input preprocessors;
  • an immutable, reusable, thread-safe CachedRatio scorer;
  • allocation-free ExtractOne, top-k ExtractTop, and ExtractAll scans over ReadOnlySpan<string>;
  • differential tests against FuzzySharp 2.0.2;
  • BenchmarkDotNet comparisons with FuzzySharp 2.0.2 and Raffinert.FuzzySharp 5.0.3;
  • a NativeAOT publish smoke test.

DotFuzz keeps score meaning compatible with FuzzySharp while staying span-first and preprocessing-free by default; it does not reproduce FuzzySharp's API surface one-to-one.

Quick start

using DotFuzz;
using DotFuzz.Cached;
using DotFuzz.Distance;

int distance = Indel.Distance("kitten".AsSpan(), "sitting".AsSpan());
int score = Fuzz.Ratio("mysmilarstring".AsSpan(), "mysimilarstring".AsSpan());
int pruned = Fuzz.Ratio("query".AsSpan(), "candidate".AsSpan(), scoreCutoff: 80);

int partial = Fuzz.PartialRatio("yankees".AsSpan(), "new york yankees".AsSpan());
int sorted = Fuzz.TokenSortRatio("fuzzy wuzzy was a bear", "wuzzy fuzzy was a bear");
int set = Fuzz.TokenSetRatio("fuzzy was a bear", "fuzzy fuzzy was a bear");
int weighted = Fuzz.WeightedRatio("this is a test", "this is a test!");

string processed = Preprocess.Compatibility("New York Mets!"); // "new york mets"

var cached = new CachedRatio("new york mets");
int cachedScore = cached.Score("new york mets tickets".AsSpan());

string[] choices = ["Atlanta Falcons", "New York Jets", "Dallas Cowboys"];
ExtractOneResult best = Process.ExtractOne(new CachedRatio("cowboys"), choices);
ExtractResult[] top = Process.ExtractTop("New York Jets", choices, limit: 2);
ExtractResult[] all = Process.ExtractAll("New York Jets", choices, scoreCutoff: 50);

Every scorer is case-sensitive and performs no implicit preprocessing. Scoring operates over UTF-16 code units, uses normalized Indel similarity, and returns an integer from 0 to 100. Passing a cutoff returns zero when the score cannot reach the threshold. To reproduce FuzzySharp's fully processed modes, run inputs through Preprocess.Compatibility (or the Unicode-aware Preprocess.Unicode) first.

Indel.Distance returns the exact insertion/deletion distance by default. With a cutoff, it returns cutoff + 1 as a sentinel when the exact result is larger.

Requirements

Build and verify

dotnet restore DotFuzz.slnx
dotnet build DotFuzz.slnx -c Release --no-restore
dotnet test DotFuzz.slnx -c Release --no-restore
dotnet publish tests/DotFuzz.AotSmoke/DotFuzz.AotSmoke.csproj \
  -c Release -r <your-runtime-identifier> --self-contained

Formatting is enforced with CSharpier, pinned as a local tool:

dotnet tool restore
dotnet csharpier format .

Run every benchmark or select one suite:

dotnet run -c Release \
  --project benchmarks/DotFuzz.Benchmarks/DotFuzz.Benchmarks.csproj \
  -- --filter '*PairwiseRatioBenchmarks*' --job short

Repository map

src/DotFuzz/                   shipping library
  Distance/                    Indel and bit-parallel LCS engine
  Cached/                      compiled query state
  Internal/                    score/cutoff math, partial alignment, token ops
  Process/                     ExtractOne/ExtractTop/ExtractAll and result types
tests/DotFuzz.Tests/           golden, differential, property, allocation tests
tests/DotFuzz.AotSmoke/        NativeAOT console smoke test
benchmarks/DotFuzz.Benchmarks/ BenchmarkDotNet comparison suites
docs/                          architecture, compatibility, methodology, findings

Documentation

License

DotFuzz is licensed under the MIT License.

Copyright (c) 2026 Aleksandr Pavlov.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  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.
  • net10.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.0 355 8/20/2026