compare

package
v0.0.0-...-c44c8e0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Overview

Package compare implements comparators which can be used to score similarity between various build attributes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LevenshteinComparator

type LevenshteinComparator struct {
	Opts levenshtein.Options
}

LevenshteinComparator implements the TextComparator interface, and scores similarity between two strings as their Levenshtein ratio.

func (LevenshteinComparator) Compare

func (c LevenshteinComparator) Compare(s1, s2 string) float64

type TextComparator

type TextComparator interface {
	Compare(s1, s2 string) float64
}

TextComparator is an interface which can score similarity between two strings.

Jump to

Keyboard shortcuts

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