fuzzy

package
v0.1.24 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 31, 2026 License: MIT Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package fuzzy provides fzf-style subsequence matching

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MatchArgs

type MatchArgs struct {
	Pattern string
	Text    string
}

MatchArgs are the pattern and text for a single-call Match

type Matcher

type Matcher struct {
	// contains filtered or unexported fields
}

Matcher scores repeated texts against one pattern, reusing its scratch buffers across calls

func NewMatcher

func NewMatcher(pattern string) *Matcher

NewMatcher prepares a case-insensitive matcher for pattern

func (*Matcher) Match

func (m *Matcher) Match(text string) (Result, bool)

Match scores text against the matcher's pattern

type Result

type Result struct {
	Score   int
	Indices []int
}

Result is a match's rank against a pattern, and the rune offsets in the matched text to highlight

func Match

func Match(args MatchArgs) (Result, bool)

Match scores text against pattern in a single call

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL