diff options
-rw-r--r-- | skate/zippy.go | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/skate/zippy.go b/skate/zippy.go index 06793b4..fa58917 100644 --- a/skate/zippy.go +++ b/skate/zippy.go @@ -346,18 +346,18 @@ func ZippyBrefAugment(bref, raw io.Reader, w io.Writer) error { } matched = matchedRefsExtend(matched, refs, &stats) for _, bref := range matched { + stats.total++ if err := enc.Encode(bref); err != nil { return err } } - // We want to find all items in g.G1, which are not in unique. This - // is a set like operation, but we want a custom comparator. - return nil } ) zipper := zipkey.New(bref, raw, keyer, grouper) - return zipper.Run() + err := zipper.Run() + log.Println(stats) + return err } // matchedRefsExtend takes a set of (unique) biblioref docs and will emit that @@ -420,7 +420,7 @@ func uniqueMatches(docs []string, stats *statsAugment) (result []*BiblioRef, err v := hash(doc) if seen.Contains(v) { stats.skipDuplicatedBref++ - log.Printf("skip [%d]: %v %v %v", + log.Printf("skip-dup-bref [%d]: %v %v %v", stats.skipDuplicatedBref, doc.SourceReleaseIdent, doc.MatchStatus, doc.MatchReason) continue } @@ -433,6 +433,12 @@ func uniqueMatches(docs []string, stats *statsAugment) (result []*BiblioRef, err type statsAugment struct { skipDuplicatedBref int64 skipDuplicatedRef int64 + total int64 +} + +func (s statsAugment) String() string { + return fmt.Sprintf("total=%d, skipDuplicatedRef=%d, skipDuplicatedBref=%d", + s.total, s.skipDuplicatedRef, s.skipDuplicatedBref) } // CutBatch runs Cut over a list of lines. |