model

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Pacage model contains main structures and interfaces that describe input,

output and methods that provide functionality for gnmatcher service.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Match

type Match struct {
	// ID is UUIDv5 generated from verbatim input name-string.
	ID string
	// Name is verbatim input name-string.
	Name string
	// VirusMatch is true if matching
	VirusMatch bool
	// RankMatch is true if there was a match by full canonical form for
	// ranked infraspecies.
	RankMatch bool
	// MatchType describe what kind of match happened.
	MatchType gn.MatchType
	// MatchItems provide all matched data. It will be empty if no matches
	// occured.
	MatchItems []MatchItem
}

Match is output of MatchAry method.

type MatchItem

type MatchItem struct {
	// ID is a UUIDv5 generated out of MatchStr.
	ID string
	// MatchStr is the string that matched a particular input. More often than
	// not it is a canonical form of a name. However for ranked infraspecies it
	// might be a 'full' canonical form that includes rank, and for viruses it
	// can be matched string from the database.
	MatchStr string
	// EditDistance is a Levenshtein edit distance between normalized
	// input and MatchStr.
	EditDistance int
	// EditDistanceStem is a Levenshtein edit distance between stemmed input and
	// stemmed MatchStr.
	EditDistanceStem int
}

MatchItem describes one matched string and its properties.

type MatcherService

type MatcherService interface {
	// GetPort returns port of the service.
	GetPort() int

	// Ping checks connection to the service.
	Ping() Pong

	// GetVersion sends current version and build timestamp of
	// gnmatcher.
	GetVersion() Version

	// MatchAry takes a list of strings and matches each of them
	// to known scientific names.
	MatchAry([]string) []*Match
}

MatcherService describes remote service of gnmatchter.

type Pong

type Pong string

Pong is output from Ping method. Suppose to return "pong".

type Version

type Version struct {
	// Version of gnmatcher.
	Version string
	// Build timestamp of gnmatcher.
	Build string
}

Version is output from GetVersion method.

Jump to

Keyboard shortcuts

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