Skip to content

Fuzzy fuzz partialtokensortratio

github-actions[bot] edited this page Aug 27, 2026 · 26 revisions

Development build. This page describes main, not a released package. The latest published Lodestar.Fuzzy is 0.4.0 — read its documentation.

Fuzz.PartialTokenSortRatio

Sorted words, compared over the best-matching window.

public static double PartialTokenSortRatio(string a, string b)

Parametersa and b are the strings to compare.

Returnsdouble in [0, 100]: the words are sorted, then PartialRatio is applied.

Example — reordered words, scored as a fragment.

using Lodestar.Fuzzy;

double score = Fuzz.PartialTokenSortRatio("new york mets", "mets new york");  // => 100

Remarks — both transformations at once: order stops counting and one side may be a fragment of the other. That is two kinds of forgiveness compounded, so it scores high on pairs a person would call unrelated — which is why it is worth choosing deliberately rather than reaching for as a default.

When the input is not known in advance, WRatio chooses among the scorers instead of applying the most forgiving one unconditionally.

Applies to — net10.0, netstandard2.0.

See alsoFuzz.TokenSortRatio, Fuzz.PartialRatio.

Lodestar

Project

Clone this wiki locally