Documentation ¶
Index ¶
- Variables
- func Init(scheme string) bool
- func NormalizeRunes(runes []rune) []rune
- type Algo
- type Result
- func EqualMatch(caseSensitive bool, normalize bool, forward bool, text *util.Chars, ...) (Result, *[]int)
- func ExactMatchNaive(caseSensitive bool, normalize bool, forward bool, text *util.Chars, ...) (Result, *[]int)
- func FuzzyMatchV1(caseSensitive bool, normalize bool, forward bool, text *util.Chars, ...) (Result, *[]int)
- func FuzzyMatchV2(caseSensitive bool, normalize bool, forward bool, input *util.Chars, ...) (Result, *[]int)
- func PrefixMatch(caseSensitive bool, normalize bool, forward bool, text *util.Chars, ...) (Result, *[]int)
- func SuffixMatch(caseSensitive bool, normalize bool, forward bool, text *util.Chars, ...) (Result, *[]int)
Constants ¶
This section is empty.
Variables ¶
var DEBUG bool
Functions ¶
func NormalizeRunes ¶
NormalizeRunes normalizes latin script letters
Types ¶
type Algo ¶
type Algo func(caseSensitive bool, normalize bool, forward bool, input *util.Chars, pattern []rune, withPos bool, slab *util.Slab) (Result, *[]int)
Algo functions make two assumptions 1. "pattern" is given in lowercase if "caseSensitive" is false 2. "pattern" is already normalized if "normalize" is true
type Result ¶
Result contains the results of running a match function.
func EqualMatch ¶
func EqualMatch(caseSensitive bool, normalize bool, forward bool, text *util.Chars, pattern []rune, withPos bool, slab *util.Slab) (Result, *[]int)
EqualMatch performs equal-match
func ExactMatchNaive ¶
func ExactMatchNaive(caseSensitive bool, normalize bool, forward bool, text *util.Chars, pattern []rune, withPos bool, slab *util.Slab) (Result, *[]int)
ExactMatchNaive is a basic string searching algorithm that handles case sensitivity. Although naive, it still performs better than the combination of strings.ToLower + strings.Index for typical fzf use cases where input strings and patterns are not very long.
Since 0.15.0, this function searches for the match with the highest bonus point, instead of stopping immediately after finding the first match. The solution is much cheaper since there is only one possible alignment of the pattern.
func FuzzyMatchV1 ¶
func FuzzyMatchV1(caseSensitive bool, normalize bool, forward bool, text *util.Chars, pattern []rune, withPos bool, slab *util.Slab) (Result, *[]int)
FuzzyMatchV1 performs fuzzy-match