Skip to content

Fuzzy fuzz tokensortratio

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

Fuzz.TokenSortRatio

The words sorted before comparing, so their order stops counting.

public static double TokenSortRatio(string a, string b)

Parametersa and b are the strings to compare.

Returnsdouble in [0, 100], the Ratio of the two strings after each is split into words, sorted and rejoined.

Example — the same words in a different order.

using Lodestar.Fuzzy;

double reordered = Fuzz.TokenSortRatio("new york mets", "mets new york");  // => 100

Remarks100, where Ratio on the same pair is much lower. Word order is the difference, and for names, addresses and titles it usually carries no meaning — "Smith, John" and "John Smith" are one person.

It still counts extra words against you: a side with a word the other lacks scores lower, which is the difference from TokenSetRatio.

Applies to — net10.0, netstandard2.0.

See alsoFuzz.TokenSetRatio, Fuzz.Ratio.

Lodestar

Project

Clone this wiki locally