func match(a, b term.SettingLine) (float32, bool) { if a.Slots() != b.Slots() { return 0.0, false } switch a := a.(type) { case term.ActionCID: switch b := b.(type) { case term.ActionCID: return 1 - distance(a.String(), b.String()), true default: return 0.0, false } case term.TemplateID: switch b := b.(type) { case term.TemplateID: return 1 - distance(a.String(), b.String()), true default: return 0.0, false } default: return 0.0, false } }