algo

package
v0.0.0-...-a67dd81 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2016 License: MIT, MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EqualMatch

func EqualMatch(caseSensitive bool, forward bool, runes []rune, pattern []rune) (int, int)

EqualMatch performs equal-match

func ExactMatchNaive

func ExactMatchNaive(caseSensitive bool, forward bool, runes []rune, pattern []rune) (int, 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.

We might try to implement better algorithms in the future: http://en.wikipedia.org/wiki/String_searching_algorithm

func FuzzyMatch

func FuzzyMatch(caseSensitive bool, forward bool, runes []rune, pattern []rune) (int, int)

FuzzyMatch performs fuzzy-match

func PrefixMatch

func PrefixMatch(caseSensitive bool, forward bool, runes []rune, pattern []rune) (int, int)

PrefixMatch performs prefix-match

func SuffixMatch

func SuffixMatch(caseSensitive bool, forward bool, input []rune, pattern []rune) (int, int)

SuffixMatch performs suffix-match

Types

This section is empty.

Jump to

Keyboard shortcuts

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