aboutsummaryrefslogtreecommitdiffstats
path: root/skate/zippy.go
diff options
context:
space:
mode:
Diffstat (limited to 'skate/zippy.go')
-rw-r--r--skate/zippy.go11
1 files changed, 6 insertions, 5 deletions
diff --git a/skate/zippy.go b/skate/zippy.go
index 7aff7a6..152e93f 100644
--- a/skate/zippy.go
+++ b/skate/zippy.go
@@ -313,10 +313,11 @@ func ZippyVerifyRefsOpenLibrary(olr, refs io.Reader, w io.Writer) error {
return zipper.Run()
}
-// ZippyBrefAugment takes all matched elements from bref and adds docs from raw
+// ZippyBrefAugment takes all matched docs from bref and adds docs from raw
// refs, which have not been matched. It also gets rid of duplicate matches.
//
-// We can identify, which docs have been matched by checking the ref key and index.
+// We can identify, which docs have been matched by checking the source ident,
+// ref index and key.
func ZippyBrefAugment(bref, raw io.Reader, w io.Writer) error {
var (
enc = json.NewEncoder(w)
@@ -357,8 +358,8 @@ func ZippyBrefAugment(bref, raw io.Reader, w io.Writer) error {
// matchedRefsExtend takes a set of (unique) biblioref docs and will emit that
// set of biblioref docs (unchanged) plus raw references as biblioref, which
-// did not result in a match (determined by ref key and index).
-func matchedRefsExtend(matched []*BiblioRef, refs []*Ref) {
+// did not result in a match (determined by e.g. ref key and index).
+func matchedRefsExtend(matched []*BiblioRef, refs []*Ref) []*BiblioRef {
s := set.New() // store key + index of matched items
for _, m := range matched {
s.Add(m.Key + fmt.Sprintf("%d", m.RefIndex))
@@ -381,7 +382,7 @@ func matchedRefsExtend(matched []*BiblioRef, refs []*Ref) {
bref.MatchReason = ReasonUnknown.Short()
matched = append(matched, &bref)
}
- return
+ return matched
}
// uniqueMatches takes a list of bref docs (unserialized) and will return a