e9874d6e0c
Signed-off-by: Michael Mayer <michael@liquidbytes.net>
18 lines
303 B
Go
18 lines
303 B
Go
package classify
|
|
|
|
type LabelRule struct {
|
|
Label string
|
|
Threshold float32
|
|
Categories []string
|
|
Priority int
|
|
}
|
|
|
|
type LabelRules map[string]LabelRule
|
|
|
|
func (rules LabelRules) Find(label string) LabelRule {
|
|
if rule, ok := rules[label]; ok {
|
|
return rule
|
|
}
|
|
|
|
return LabelRule{Threshold: 0.1}
|
|
}
|