fuzzy

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2026 License: MIT Imports: 3 Imported by: 0

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