Fuzzy fuzz - CyrilB1531/lodestar GitHub Wiki
Development build. This page describes
main, not a released package. The latest published Lodestar.Fuzzy is 0.4.0 — read its documentation.
Home › Fuzzy › Fuzzy matching
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
Remarks — 100 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 also — Process, 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. |