/BoomTown.FuzzySharp

Port of FuzzyWuzzy for c#

Primary LanguageC#GNU General Public License v3.0GPL-3.0

FuzzySharp

FuzzyWuzzy C# (DotNet) Implementation

Fuzzy string matching for C# based on FuzzyWuzzy Python algorithm. The algorithm uses Levenshtein distance to calculate similarity between strings.

This project is a port of the JavaWuzzy implementation because of the language similarities.

The FuzzySharp library is a .netstandard 1.0 project. To run the unit tests you will need .netcore 2.0.

Available on nuget.org

Benefits of this project include

  • No Dependencies!
  • Can be used in full .Net (>4.5) or .Net Core (>1.0) applications!

Examples

Simple Ratio

 Fuzzy.Ratio("hello world", "hello word"); 
 95

Partial Ratio

 Fuzzy.PartialRatio("my new test", "these are my new test strings");
 100

Simple Ratio With String Options

 Fuzzy.Ratio("HelLO woRld!!", "hello word", StringOptions.CaseSensitive, StringOptions.PreserveNonAlphaNumeric);
 52

Token Sort Ratio

 Fuzzy.TokenSortPartialRatio("order words out of", "words out of order");
 100
 Fuzzy.TokenSortRatio("order words out of", "word out of order");
 97

Token Set Ratio

 Fuzzy.TokenSetPartialRatio("fuzzy was a bear", "fuzzy fuzzy was a bear");
 100
 Fuzzy.TokenSetRatio("fuzzy was a bear", "fuzzy fuzzy was a bear");
 100

Weighted Ratio

 Fuzzy.WeightedRatio("ratios are awesomething things", "ratios solve things and problems");
 65

Credits