filter

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrSelectionEmpty = common.Error("selection is empty")

	MetricLevenshtein  = metrics.NewLevenshtein()
	MetricHamming      = metrics.NewHamming()
	MetricJaccard      = metrics.NewJaccard()
	MetricJaro         = metrics.NewJaro()
	MetricJaroWinkler  = metrics.NewJaroWinkler()
	MetricSorensenDice = metrics.NewSorensenDice()

	Metrics = ComposedStringMetric{
		MetricLevenshtein,
		MetricHamming,
		MetricJaccard,
		MetricJaro,
		MetricJaroWinkler,
		MetricSorensenDice,
	}

	MetricNames = []string{
		"Levenshtein",
		"Hamming",
		"Jaccard",
		"Jaro",
		"JaroWinkler",
		"SorensenDice",
	}
)
View Source
var (
	VideoFileExtensionsMap = map[string]bool{}
)

Functions

func BestMatch

func BestMatch(comp string, selection []string, metric strutil.StringMetric) (distance float64, index int, err error)

func BestMatchNested

func BestMatchNested(comp string, selections [][]string, metric strutil.StringMetric) (distance float64, outerIndex, innerIndex int, err error)

func ExtractEpisode

func ExtractEpisode(searchTerm string) (string, bool)

ExtractEpisode tries to extract a numeric value. Returns the string match and whether something was found

func VideoFilePaths

func VideoFilePaths(vfs []string) []string

Types

type ComposedStringMetric

type ComposedStringMetric []strutil.StringMetric

func (ComposedStringMetric) Compare

func (cm ComposedStringMetric) Compare(a, b string) float64

Jump to

Keyboard shortcuts

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