Documentation ¶
Index ¶
- func Max(ss ...Set) (max int)
- func Min(ss ...Set) (min int)
- type Set
- func (s Set) Add(v string) Set
- func (s Set) Clear()
- func (s Set) Contains(v string) bool
- func (s Set) Difference(t Set) Set
- func (s Set) Equals(t Set) bool
- func (s Set) Intersection(t Set) Set
- func (s Set) IsEmpty() bool
- func (s Set) Jaccard(t Set) float64
- func (s Set) Join(sep string) string
- func (s Set) Len() int
- func (s Set) Product(t Set) (result [][]string)
- func (s Set) Slice() (result []string)
- func (s Set) Sorted() (result []string)
- func (s Set) TopK(k int) Set
- func (s Set) Union(t Set) Set
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Set ¶
type Set map[string]struct{}
Set implements basic string set operations, not thread-safe.
func (Set) Difference ¶
func (Set) Intersection ¶
Intersection returns a new set containing all elements found in both sets.
func (Set) Jaccard ¶
Jaccard returns the jaccard index of sets s and t, between 0 and 1, where 1 means equality.
func (Set) Product ¶
Product returns a slice of pairs, representing the cartesian product of two sets.
Click to show internal directories.
Click to hide internal directories.