This scoring algorithm uses a sum-of-deltas approach to determine
the score. In order for there to be a match, all of the characters
in querymust appear in source in order. The delta between
the indices are summed to create the score. This means that groups
of matched characters are preferred, while fragmented matches are
penalized.
A string matcher which uses a sum-of-deltas algorithm.
Returns
The match result, or
nullif there is no match. A lowerscorerepresents a stronger match.Complexity
Linear on
sourceText.Notes
This scoring algorithm uses a sum-of-deltas approach to determine the score. In order for there to be a match, all of the characters in
querymust appear insourcein order. The delta between the indices are summed to create the score. This means that groups of matched characters are preferred, while fragmented matches are penalized.