Documentation
¶
Overview ¶
Package matcher provides main data-structures that describe input and
output of gnmatcher functionality.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FuzzyMatcher ¶
type FuzzyMatcher interface {
// MatchStem takes a stemmed scientific name and max edit distance.
// The search stops if current edit distance becomes bigger than edit
// distance. The method returns 0 or more stems that did match the
// input stem within the edit distance constraint.
MatchStem(stem string, maxEditDistance int) []string
// StemToCanonicals takes a stem and returns back canonicals
// that correspond to that stem.
StemToMatchItems(stem string) []MatchItem
}
FuzzyMatcher describes methods needed for fuzzy matching
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
// MatchType describe what kind of match happened.
MatchType vlib.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 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.
Click to show internal directories.
Click to hide internal directories.