verifier

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: 3 Imported by: 1

Documentation

Overview

Package verifier provides data about biodiversity data-sources and metadata about scientific names aggregated from them. The package includes an interface for the data access.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MatchRecord

type MatchRecord struct {
	ID              string
	Name            string
	Cardinality     int
	CanonicalSimple string
	CanonicalFull   string
	Authors         []string
	Year            int
	DataSourcesNum  int
	DataSourcesIDs  []int
	Overload        bool
	// MatchResults contains all matches to Input.
	MatchResults []*vlib.ResultData
	// Sorted indicates if MatchResults are already sorted by their Score field.
	Sorted bool
}

MatchRecord contains information necessary for generating final verification output. Most of its fields has the same semantic meaning as `entity.Verification` fields.

type Verifier

type Verifier interface {
	// DataSources returns a slice of all data-sources known to gnames. If
	// idd are provided, it returns a slice of requested data-sources.
	DataSources(ids ...int) ([]*vlib.DataSource, error)

	// MatchRecords function returns unsorted records corresponding to Input
	// matches.  Matches contain an input name-string, and strings that matched
	// that input.
	MatchRecords(
		ctx context.Context,
		matches []mlib.Match,
		input vlib.Input,
	) (map[string]*MatchRecord, error)
}

Verifier is an interface that can be implemented by any data provider able to prepare raw data for verification.

Jump to

Keyboard shortcuts

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