Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .github/workflows/build-nuget-packages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Build, Test, and Package

on:
push:
pull_request:
workflow_dispatch:

permissions:
contents: read

jobs:
build:
name: Build, test, and pack
runs-on: windows-latest

steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Set up .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 10.0.x

- name: Restore
run: dotnet restore FuzzySharp.slnx

- name: Build
run: dotnet build FuzzySharp.slnx --configuration Release --no-restore -p:GeneratePackageOnBuild=false

- name: Test
run: dotnet test FuzzySharp.Test/FuzzySharp.Test.csproj --configuration Release --no-restore --no-build

- name: Pack
run: dotnet pack FuzzySharp/FuzzySharp.csproj --configuration Release --no-restore --no-build --output artifacts -p:GeneratePackageOnBuild=false -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg

- name: Upload NuGet packages
uses: actions/upload-artifact@v4
with:
name: nuget-packages
path: |
artifacts/*.nupkg
artifacts/*.snupkg
if-no-files-found: error
41 changes: 0 additions & 41 deletions .github/workflows/development_package.yml

This file was deleted.

47 changes: 0 additions & 47 deletions .github/workflows/master_package_and_publish.yml

This file was deleted.

9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## v6.0.0

*Double-precision scoring and simplified distance APIs*

- **Breaking:** Removed `scoreCutoff` from the Indel, Levenshtein, LCS, and partial-ratio APIs.
- **Breaking:** Scorers, scoring strategies, `Fuzz` methods, and extracted-result scores now use `double` and preserve fractional similarity values.
- Extraction `cutoff` parameters now accept `double` values.
- Optimized pattern-match-vector construction with bulk character population, a dedicated single-block fast path, lazy non-ASCII storage, and direct dense-mask lookup for ASCII characters.

## v5.0.3

*Extractor selection performance and allocation improvements*
Expand Down
18 changes: 9 additions & 9 deletions FuzzySharp.Benchmarks/ExtractSelectionBenchmarks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -203,20 +203,20 @@ internal static IEnumerable<ExtractedResult<string>> LegacyParallelCachedExtract

private sealed class CheapScorer : IRatioScorer
{
public int Score(string input1, string input2)
public double Score(string input1, string input2)
{
return ScoreFromChoice(input2);
}

public int Score(string input1, string input2, Func<string, string> preprocessor)
public double Score(string input1, string input2, Func<string, string> preprocessor)
{
return Score(preprocessor(input1), preprocessor(input2));
}
}

private sealed class CheapCachedScorer : ICachedRatioScorer
{
public int Score(string input2)
public double Score(string input2)
{
return ScoreFromChoice(input2);
}
Expand Down Expand Up @@ -335,20 +335,20 @@ public List<ExtractedResult<string>> Legacy_ParallelCached_ExtractTop()

private sealed class CheapScorer : IRatioScorer
{
public int Score(string input1, string input2)
public double Score(string input1, string input2)
{
return ScoreFromChoice(input2);
}

public int Score(string input1, string input2, Func<string, string> preprocessor)
public double Score(string input1, string input2, Func<string, string> preprocessor)
{
return Score(preprocessor(input1), preprocessor(input2));
}
}

private sealed class CheapCachedScorer : ICachedRatioScorer
{
public int Score(string input2)
public double Score(string input2)
{
return ScoreFromChoice(input2);
}
Expand Down Expand Up @@ -497,20 +497,20 @@ public List<ExtractedResult<string>> Legacy_ParallelCached_ExtractTop()

private sealed class CheapScorer : IRatioScorer
{
public int Score(string input1, string input2)
public double Score(string input1, string input2)
{
return ScoreFromChoice(input2);
}

public int Score(string input1, string input2, Func<string, string> preprocessor)
public double Score(string input1, string input2, Func<string, string> preprocessor)
{
return Score(preprocessor(input1), preprocessor(input2));
}
}

private sealed class CheapCachedScorer : ICachedRatioScorer
{
public int Score(string input2)
public double Score(string input2)
{
return ScoreFromChoice(input2);
}
Expand Down
6 changes: 3 additions & 3 deletions FuzzySharp.Benchmarks/LevenshteinDistance/LevenshteinLarge.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public void NaiveDp()
}

[Benchmark]
public void FuzzySharpClassic()
public void FuzzySharp()
{
for (var i = 0; i < _words.Length; i++)
{
Expand Down Expand Up @@ -67,8 +67,8 @@ public void Quickenshtein()
}
}

[Benchmark]
public void FuzzySharp()
[Benchmark(Description = "Raffinert.FuzzySharp")]
public void ThisLibrary()
{
for (var i = 0; i < _words.Length; i++)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public void NaiveDp()
}

[Benchmark]
public void FuzzySharpClassic()
public void FuzzySharp()
{
for (var i = 0; i < _words.Length; i++)
{
Expand Down Expand Up @@ -68,8 +68,8 @@ public void Quickenshtein()
}
}

[Benchmark]
public void FuzzySharp()
[Benchmark(Description = "Raffinert.FuzzySharp")]
public void ThisLibrary()
{
for (var i = 0; i < _words.Length; i++)
{
Expand Down
6 changes: 3 additions & 3 deletions FuzzySharp.Benchmarks/LevenshteinDistance/LevenshteinSmall.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public void NaiveDp()
}

[Benchmark]
public void FuzzySharpClassic()
public void FuzzySharp()
{
for (var i = 0; i < _words.Length; i++)
{
Expand Down Expand Up @@ -67,8 +67,8 @@ public void Quickenshtein()
}
}

[Benchmark]
public void FuzzySharp()
[Benchmark(Description = "Raffinert.FuzzySharp")]
public void ThisLibrary()
{
for (var i = 0; i < _words.Length; i++)
{
Expand Down
4 changes: 2 additions & 2 deletions FuzzySharp.Benchmarks/PartialRatioBenchmarks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ namespace Raffinert.FuzzySharp.Benchmarks;
public class PartialRatioBenchmarks
{
[Benchmark]
public int PartialRatio()
public double PartialRatio()
{
return Fuzz.PartialRatio("similar", "somewhresimlrbetweenthisstring");
}

[Benchmark]
public int PartialRatioClassic()
public double PartialRatioClassic()
{
return Classic.Fuzz.PartialRatio("similar", "somewhresimlrbetweenthisstring");
}
Expand Down
4 changes: 2 additions & 2 deletions FuzzySharp.Benchmarks/PartialRatioLongBenchmarks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ private static string GenerateString(int length, Random rnd)
}

[Benchmark]
public int PartialRatio()
public double PartialRatio()
{
return Fuzz.PartialRatio(_s1, _s2);
}

[Benchmark]
public int PartialRatioClassic()
public double PartialRatioClassic()
{
return Classic.Fuzz.PartialRatio(_s1, _s2);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ namespace Raffinert.FuzzySharp.Benchmarks;
public class PartialTokenAbbreviationRatioBenchmarks
{
[Benchmark]
public int PartialTokenAbbreviationRatio()
public double PartialTokenAbbreviationRatio()
{
return Fuzz.PartialTokenAbbreviationRatio("bl 420", "Baseline section 420", StringPreprocessor.Full);
}

[Benchmark]
public int PartialTokenAbbreviationRatioClassic()
public double PartialTokenAbbreviationRatioClassic()
{
return Classic.Fuzz.PartialTokenAbbreviationRatio("bl 420", "Baseline section 420", Classic.PreProcess.PreprocessMode.Full);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ namespace Raffinert.FuzzySharp.Benchmarks;
public class PartialTokenInitialismRatioBenchmarks
{
[Benchmark]
public int PartialTokenInitialismRatio()
public double PartialTokenInitialismRatio()
{
return Fuzz.PartialTokenInitialismRatio("NASA", "National Aeronautics Space Administration, Kennedy Space Center, Cape Canaveral, Florida 32899");
}

[Benchmark]
public int PartialTokenInitialismRatioClassic()
public double PartialTokenInitialismRatioClassic()
{
return Classic.Fuzz.PartialTokenInitialismRatio("NASA", "National Aeronautics Space Administration, Kennedy Space Center, Cape Canaveral, Florida 32899");
}
Expand Down
8 changes: 4 additions & 4 deletions FuzzySharp.Benchmarks/PartialTokenSetRatioBenchmarks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,25 @@ public void GlobalSetup()
}

[Benchmark]
public int PartialTokenSetRatio()
public double PartialTokenSetRatio()
{
return Fuzz.PartialTokenSetRatio("fuzzy was a bear", "fuzzy fuzzy fuzzy bear");
}

[Benchmark]
public int PartialTokenSetRatioClassic()
public double PartialTokenSetRatioClassic()
{
return Classic.Fuzz.PartialTokenSetRatio("fuzzy was a bear", "fuzzy fuzzy fuzzy bear");
}

[Benchmark]
public int PartialTokenSetRatioCached()
public double PartialTokenSetRatioCached()
{
return new CachedPartialTokenSetScorer("fuzzy was a bear").Score("fuzzy fuzzy fuzzy bear");
}

[Benchmark]
public int PartialTokenSetRatioAcrossRunsCached()
public double PartialTokenSetRatioAcrossRunsCached()
{
return _cachedPartialTokenSetScorer.Score("fuzzy fuzzy fuzzy bear");
}
Expand Down
4 changes: 2 additions & 2 deletions FuzzySharp.Benchmarks/PartialTokenSortRatioBenchmarks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ namespace Raffinert.FuzzySharp.Benchmarks;
public class PartialTokenSortRatioBenchmarks
{
[Benchmark]
public int PartialTokenSortRatio()
public double PartialTokenSortRatio()
{
return Fuzz.PartialTokenSortRatio("order words out of", " words out of order");
}

[Benchmark]
public int PartialTokenSortRatioClassic()
public double PartialTokenSortRatioClassic()
{
return Classic.Fuzz.PartialTokenSortRatio("order words out of", " words out of order");
}
Expand Down
Loading
Loading