fuzzy

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FuzzyMatcher

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

FuzzyMatcher provides fuzzy string matching capabilities for agent discovery

func NewFuzzyMatcher

func NewFuzzyMatcher(threshold float64) *FuzzyMatcher

NewFuzzyMatcher creates a new fuzzy matcher with the specified threshold threshold should be between 0.0 and 1.0, where higher values require closer matches

func (*FuzzyMatcher) FindBest

func (fm *FuzzyMatcher) FindBest(query string, agents []*parser.AgentSpec) *parser.AgentSpec

FindBest finds the best matching agent from the provided list Returns nil if no match exceeds the threshold

func (*FuzzyMatcher) FindMultiple

func (fm *FuzzyMatcher) FindMultiple(query string, agents []*parser.AgentSpec, limit int) []*parser.AgentSpec

FindMultiple finds multiple matching agents, sorted by score (best first) If limit is 0, returns all matches above threshold

func (*FuzzyMatcher) MultiFieldSearch

func (fm *FuzzyMatcher) MultiFieldSearch(query string, agents []*parser.AgentSpec, fields []string, limit int) []*parser.AgentSpec

MultiFieldSearch searches across multiple fields with relevance scoring

func (*FuzzyMatcher) Score

func (fm *FuzzyMatcher) Score(s1, s2 string) float64

Score calculates similarity between two strings using multiple algorithms

func (*FuzzyMatcher) ScoreByField

func (fm *FuzzyMatcher) ScoreByField(agent *parser.AgentSpec, field, query string) float64

ScoreByField calculates similarity score between query and specific agent field

func (*FuzzyMatcher) SetThreshold

func (fm *FuzzyMatcher) SetThreshold(threshold float64)

SetThreshold updates the matching threshold

Jump to

Keyboard shortcuts

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