v0.1.9 Latest Latest

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

Go to latest
Published: Jan 23, 2021 License: MIT Imports: 1 Imported by: 0



Package matcher provides main data-structures that describe input and

output of gnmatcher functionality.



This section is empty.


This section is empty.


This section is empty.


type Match

type Match struct {
	// ID is UUIDv5 generated from verbatim input name-string.
	ID string `json:"id"`
	// Name is verbatim input name-string.
	Name string `json:"input"`
	// VirusMatch is true if matching
	VirusMatch bool `json:"isVirus,omitempty"`
	// MatchType describe what kind of match happened.
	MatchType vlib.MatchTypeValue `json:"matchType"`
	// MatchItems provide all matched data. It will be empty if no matches
	// occured.
	MatchItems []MatchItem `json:"matchItems,omitempty"`

Match is output of MatchAry method.

type MatchItem

type MatchItem struct {
	// ID is a UUIDv5 generated out of MatchStr.
	ID string `json:"id"`
	// 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 `json:"matchString"`
	// EditDistance is a Levenshtein edit distance between normalized
	// input and MatchStr.
	EditDistance int `json:"editDistance"`
	// EditDistanceStem is a Levenshtein edit distance between stemmed input and
	// stemmed MatchStr.
	EditDistanceStem int `json:"editDistanceStem"`

MatchItem describes one matched string and its properties.

Jump to

Keyboard shortcuts

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