github.com/egonelbre/exp@v0.0.0-20240430123955-ed1d3aa93911/fuzzy/fuzzytext/search.go (about)

     1  package fuzzytext
     2  
     3  const (
     4  	SequentialBonus  = 15 // bonus for adjacent matches
     5  	SeparatorBonus   = 30 // bonus if match occurs after a separator
     6  	CamelBonus       = 30 // bonus if match is uppercase and prev is lower
     7  	FirstLetterBonus = 15 // bonus if the first letter is matched
     8  
     9  	MaxLeadingLetterPenalty = -15 // penalty applied for every letter in str before the first match
    10  	LeadingLetterPenalty    = -5  // maximum penalty for leading letters
    11  	UnmatchedLetterPenalty  = -1
    12  )