score

package
Version: v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2022 License: MIT Imports: 6 Imported by: 1

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

	// Results returns the best-scoring result for each of the
	// given selected data-sources.
	Results(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 selected data-sources.

func New added in v0.5.8

func New(value ...uint32) Score

New returns an implementation of the Score interface.

Jump to

Keyboard shortcuts

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