Fuzzy 0.4.0 fuzz partialtokensetratio - CyrilB1531/lodestar GitHub Wiki
Lodestar.Fuzzy 0.4.0. This page is frozen at that release. Read the current documentation for what
mainsays now. A link to a decision or a migration page followsmain, and leaves the archive.
Fuzz.PartialTokenSetRatio
Word sets, compared over the best-matching window.
public static double PartialTokenSetRatio(string a, string b)
Parameters — a and b are the strings to compare.
Returns — double in [0, 100]: the word sets are formed, then
PartialRatio is applied.
Example — a subset of the words, scored as a fragment.
using Lodestar.Fuzzy;
string query = "mariners vs angels";
string candidate = "los angeles angels vs seattle mariners";
double score = Fuzz.PartialTokenSetRatio(query, candidate); // => 100
Remarks — the most forgiving of the seven, and the one to justify before using. It ignores
word order, ignores extra words, and scores the best window rather than the whole — three
allowances at once, so a 100 here says much less than a 100 from Ratio.
It earns its place on messy, human-entered text where every one of those three differences is noise. On clean data it will merge records that should stay apart.
Applies to — net10.0, netstandard2.0.
See also — Fuzz.TokenSetRatio, Fuzz.WRatio.