score

package
Version: v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package score allows to sort matched records according to their relevancy.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Score

type Score interface {
	fmt.Stringer
	// SortResults takes a pointer for verifier.MatchRecord calculates the score
	// for all MatachResults and sorts them in reverse order according to
	// the calculated score. The highest-scored record is the first, and the
	// lowest-scored record is the last.
	SortResults(*verifier.MatchRecord)
	// BestResult returns the pointer to the best result according to score
	// altorithm.
	BestResult(*verifier.MatchRecord) *vlib.ResultData
	// PreferredResults returns the best-scoring result for each of the
	// given preferred data-sources.
	PreferredResults(sources []int, mr *verifier.MatchRecord) []*vlib.ResultData
}

Score inteface implements methods for finding best-matching record, according to its score, as well as return best matching records from the preferred data-sources.

func NewScore

func NewScore() Score

NewScore returns an implementation of the Score interface.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL