Skip to content

Fuzzy fuzz

github-actions[bot] edited this page Aug 22, 2026 · 23 revisions

Fuzz

The seven scorers, all returning a similarity in [0, 100].

public static class Fuzz

Example — the base scorer on a typo.

using Lodestar.Fuzzy;

double score = Fuzz.Ratio("apple pie", "appel pie");  // => 88.88888888888889

Remarks100 is identical and 0 shares nothing; the scale is rapidfuzz's, and the values match it. They are double rather than int because rapidfuzz's are, and rounding them here would make a ported comparison disagree at the boundary of a cutoff.

The seven are one scorer applied to different things: Ratio compares the strings, PartialRatio the best window, the Token* family the words after sorting or setting, and the PartialToken* pair both transformations at once. WRatio chooses among them.

Applies to — net10.0, netstandard2.0.

See alsoProcess, the matching index, the rapidfuzz guide.

Members

Member What it does
Fuzz.PartialRatio The best-matching window of the longer string.
Fuzz.PartialTokenSetRatio Set comparison over the best window.
Fuzz.PartialTokenSortRatio Sorted comparison over the best window.
Fuzz.Ratio Edit-distance similarity over the whole of both.
Fuzz.TokenSetRatio The words as sets, so extras stop counting.
Fuzz.TokenSortRatio The words sorted, so order stops counting.
Fuzz.WRatio Picks among the others by inspecting the input.

Lodestar

Project

Clone this wiki locally