Import std.text.fuzzy
std.text.fuzzy
std.text.fuzzy: fuzzy matching, as fzf does it. A pattern matches text that has its characters in order, with anything between them, and the best way to place them scores most: characters that follow each other, and ones at the start of a word, after a space, a /, or a _, or a capital in camelCase, score more, and gaps between them less. A pattern without capitals ignores case. Positions are byte positions, as a String's are.
std/text/fuzzy.fb
Types
FuzzyMatch
struct
Public Struct FuzzyMatch
What a fuzzy match found: its Score, higher for a better match, and the byte Positions of the text's characters that the pattern's matched, in order.
-
How well the pattern matched: higher for a better match.
-
The byte positions of the characters the pattern's matched, in order.
Fuzzy
class
Public Class Fuzzy
Fuzzy matching's operations.
-
The best match of
patternintext, or Null whentextdoesn't havepattern's characters in order. An emptypatternmatches anything, scoring 0. -
pattern's score intext, or Null when it doesn't match. -
The
candidatesthat matchpattern, the best first: by score, then the shorter, then in the order given.
Report an issue with this page or with FutureBlitz on GitHub.