func (db *Database) AddAllPositions(s set.Set) { for i, v := range db.FullSequence { if v != ZeroToken { s.Add(i) } } }
func (db *Database) MatchesOccs(s set.Set) (matches []int, occs []int) { matches = make([]int, len(db.Total)) occs = make([]int, len(db.Total)) prevseq := -1 for _, p := range s.Iter() { seq := db.PosToSequence[p] occs[seq.Section] += int(seq.Count) if seq.Index == prevseq { continue } matches[seq.Section] += int(seq.Count) prevseq = seq.Index } return }