Documentation
¶
Overview ¶
Package fuzzy - Entry point for fuzzy searching
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LevenshteinRatio ¶
LevenshteinRatio exposes core Levenshtein distance logic
Types ¶
type MatchResult ¶
MatchResult represents a scored search result
type SearchOptions ¶
type SearchOptions struct {
ContextBoosts map[string]int // Optional boosts for specific items
Limit int // Maximum number of results to return
}
SearchOptions provides advanced search configuration
type Searcher ¶
type Searcher struct {
Originals []string // Original items
Normalized [][]byte // Normalized items for fast matching
Memory *core.FileMemory // Frecency memory system
Filter *core.UnigramFilter // Bitset filter for candidates
// contains filtered or unexported fields
}
Searcher is the main object for performing fuzzy searches
func NewPlainSearcher ¶
NewPlainSearcher creates a searcher for plain text items
func NewSearcher ¶
NewSearcher creates a searcher optimized for file paths
func NewSearcherWithMemory ¶
func NewSearcherWithMemory(items []string, memory *core.FileMemory) *Searcher
NewSearcherWithMemory creates a searcher with existing memory
func (*Searcher) RecordSelection ¶
RecordSelection records an item selection to update frecency
func (*Searcher) Search ¶
func (s *Searcher) Search(query string, opts ...*SearchOptions) []string
Search performs fuzzy search and returns matching strings
func (*Searcher) SearchDebug ¶
SearchDebug prints debug information for a query
func (*Searcher) SearchWithScores ¶
func (s *Searcher) SearchWithScores(query string, opts ...*SearchOptions) []MatchResult
SearchWithScores performs fuzzy search and returns scored results