bhlnames

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Build = "n/a"
View Source
var Version = "v0.2.0"

Functions

This section is empty.

Types

type BHLnames

type BHLnames interface {
	// Parser returns an instance of the Global Names Parser. It is used
	// to parse scientific names.
	Parser() gnparser.GNparser

	// Initialize downloads data about BHL corpus and names found in the
	// corpus. It then imports the data into its storage.
	Initialize() error

	// InitializeCol downloads the Catalogue of Life (CoL) data and imports
	// the data about nomenclatural references for CoL names into its storage.
	InitializeCol() error

	// RefByPageID returns a reference for a given pageID.
	RefByPageID(pageID int) (*refbhl.Reference, error)

	// NameRefs takes a name and optionally reference, and find matching
	// locations and references in BHL.
	NameRefs(data input.Input) (*namerefs.NameRefs, error)

	// NameRefsStream takes a stream of names/references and returns back
	// a stream of matched locations in BHL.
	NameRefsStream(chIn <-chan input.Input, chOut chan<- *namerefs.NameRefs)

	// NomenRefs takes a name and a nomenclatural reference and returns back
	// putative locations of the nomenclatural publication in BHL.
	NomenRefs(data input.Input) (*namerefs.NameRefs, error)

	// NomenRefsStream takes a stream of names/references and returns a stream
	// of putative locations of the nomenclatural publications in BHL.
	NomenRefsStream(chIn <-chan input.Input, chOut chan<- *namerefs.NameRefs)

	// GetVersion returns back the version of BHLnames
	// @Summary Get BHLnames version
	// @Description Retrieves the current version of the BHLnames application.
	// @ID get-version
	// @Produce json
	// @Success 200 {object} gnvers.Version "Successful response with version information"
	// @Router /version [get]
	GetVersion() gnvers.Version

	// Config returns configuration data of bhlnames.
	Config() config.Config

	// ChangeConfig modifies config and returns back an instance of BHLnames
	// with updated Config.
	ChangeConfig(...config.Option) BHLnames

	// Close terminates connections to databases and key-value stores.
	Close() error
}

BHLnames provides methods for finding references for scientific names in the Biodiversity Heritage Library (BHL).

func New

func New(cfg config.Config, opts ...Option) BHLnames

New creates an instance of BHLnames.

type Option

type Option func(*bhlnames)

func OptBuilder

func OptBuilder(b builder.Builder) Option

func OptColBuild

func OptColBuild(c colbuild.ColBuild) Option

func OptNLP

func OptNLP(n nlp.NLP) Option

func OptParser

func OptParser(gnp gnparser.GNparser) Option

func OptRefFinder

func OptRefFinder(rf reffinder.RefFinder) Option

func OptTitleMatcher

func OptTitleMatcher(tm title_matcher.TitleMatcher) Option

Directories

Path Synopsis
ent

Jump to

Keyboard shortcuts

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