gotools/gopls/internal/fuzzy/matcher.go

const MaxInputSize

const MaxPatternSize

type scoreVal

func (s scoreVal) val() int {}

func (s scoreVal) prevK() int {}

func score(val int, prevK int /*0 or 1*/) scoreVal {}

type Matcher

func (m *Matcher) bestK(i, j int) int {}

// NewMatcher returns a new fuzzy matcher for scoring candidates against the provided pattern.
func NewMatcher(pattern string) *Matcher {}

// Score returns the score returned by matching the candidate to the pattern.
// This is not designed for parallel use. Multiple candidates must be scored sequentially.
// Returns a score between 0 and 1 (0 - no match, 1 - perfect match).
func (m *Matcher) Score(candidate string) float32 {}

func (m *Matcher) ScoreChunks(chunks []string) float32 {}

const minScore

// MatchedRanges returns matches ranges for the last scored string as a flattened array of
// [begin, end) byte offset pairs.
func (m *Matcher) MatchedRanges() []int {}

func (m *Matcher) match(candidate []byte, candidateLower []byte) bool {}

func (m *Matcher) computeScore(candidate []byte, candidateLower []byte) int {}

// ScoreTable returns the score table computed for the provided candidate. Used only for debugging.
func (m *Matcher) ScoreTable(candidate string) string {}

func dir(prevK int) rune {}

func (m *Matcher) poorMatch() bool {}

// BestMatch returns the name most similar to the
// pattern, using fuzzy matching, or the empty string.
func BestMatch(pattern string, names []string) string {}