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
// MatchType describe what kind of match happened.
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 MatchType ¶
type MatchType int
MatchType descrbes categories that might happen during the matching process.
const ( // None means no match was found. None MatchType = iota // Canonical means the match occured to a canonical form of a name-string. Canonical // CanonicalFull means the match happened to a exended canonical form with // ranks. CanonicalFull // Virus means there was exact match to a verbatim virus name. Virus // Fuzzy means that the match happened to canonical form, but it is not exact. Fuzzy // Partial means the complete name-string did not match, but an exact match // happened to its truncated form without some epithets. Partial // PartialFuzzy means that fuzzy match was found to a truncated name. PartialFuzzy )
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.
Click to show internal directories.
Click to hide internal directories.