Find the indices of characters in a source text.
The source text which should be searched.
The characters to locate in the source text.
The index to start the search.
The matched indices, or null
if there is no match.
Linear on sourceText
.
In order for there to be a match, all of the characters in query
must appear in source
in the order given by query
.
Characters are matched using strict ===
equality.
Highlight the matched characters of a source text.
The text which should be highlighted.
The indices of the matched characters. They must appear in increasing order and must be in bounds of the source.
The function to apply to the matched chunks.
An array of unmatched and highlighted chunks.
A string matcher which uses a sum-of-deltas algorithm.
The source text which should be searched.
The characters to locate in the source text.
The index to start the search.
The match result, or null
if there is no match.
A lower score
represents a stronger match.
Linear on sourceText
.
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 query
must 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-squares algorithm.
The source text which should be searched.
The characters to locate in the source text.
The index to start the search.
The match result, or null
if there is no match.
A lower score
represents a stronger match.
Linear on sourceText
.
This scoring algorithm uses a sum-of-squares approach to determine
the score. In order for there to be a match, all of the characters
in query
must appear in source
in order. The index of each
matching character is squared and added to the score. This means
that early and consecutive character matches are preferred, while
late matches are heavily penalized.
Generated using TypeDoc
The namespace for string-specific algorithms.