Skip to content
FutureBlitz

    Install

    Import std.text.fuzzy

    Fuzzy

    std.text.fuzzy

    class

    Public Class Fuzzy

    Fuzzy matching's operations.

    Examples

    Expect(Fuzzy.Match("fb", "foobar")?.Positions == [0, 3])
    Expect(Fuzzy.Match("fb", "xyz") == Null)
    Expect(Fuzzy.Rank("fb", ["xyz", "foobar"]) == ["foobar"])

    std/text/fuzzy.fb, line 58

    • Public Static Method Match(pattern: String, text: String): FuzzyMatch? static method #

      The best match of pattern in text, or Null when text doesn't have pattern's characters in order. An empty pattern matches anything, scoring 0.

    • Public Static Method Score(pattern: String, text: String): Int? static method #

      pattern's score in text, or Null when it doesn't match.

    • Public Static Method Rank(pattern: String, candidates: String[]): String[] static method #

      The candidates that match pattern, the best first: by score, then the shorter, then in the order given.

    Report an issue with this page or with FutureBlitz on GitHub.