go-fuzzyfinder: github.com/ktr0731/go-fuzzyfinder/matching Index | Files

package matching

import "github.com/ktr0731/go-fuzzyfinder/matching"

Package matching provides matching features that find appropriate strings by using a passed input string.


Package Files


type Matched Uses

type Matched struct {
    // Idx is the index of an item of the original slice which was used to
    // search matched strings.
    Idx int
    // Pos is the range of matched position.
    // [2]int represents an open interval of a position.
    Pos [2]int
    // contains filtered or unexported fields

Matched represents a result of FindAll.

func FindAll Uses

func FindAll(in string, slice []string, opts ...Option) []Matched

FindAll tries to find out sub-strings from slice that match the passed argument in. The returned slice is sorted by similarity scores in descending order.

type Mode Uses

type Mode int
const (
    ModeSmart Mode = iota

type Option Uses

type Option func(*opt)

Option represents available matching options.

func WithMode Uses

func WithMode(m Mode) Option

WithMode specifies a matching mode. The default mode is ModeSmart.

Package matching imports 4 packages (graph) and is imported by 1 packages. Updated 2019-04-28. Refresh now. Tools for package owners.