diff options
Diffstat (limited to 'skate/zippy.go')
-rw-r--r-- | skate/zippy.go | 36 |
1 files changed, 10 insertions, 26 deletions
diff --git a/skate/zippy.go b/skate/zippy.go index 1da280c..5c70902 100644 --- a/skate/zippy.go +++ b/skate/zippy.go @@ -159,14 +159,12 @@ func ZippyVerifyRefs(releases, refs io.Reader, w io.Writer) error { return zipper.Run() } -// ZippyRefsOpenLibrary takes a release and refs reader (tsv, with ident, key, doc) +// ZippyVerifyRefsOnly takes a release and refs reader (tsv, with ident, key, doc) // and will execute gf for each group found. -func ZippyRefsOpenLibrary(olr, refs io.Reader, w io.Writer) error { +func ZippyVerifyRefsOnly(releases, refs io.Reader, w io.Writer) error { // Define a grouper, working on one set of refs and releases with the same - // key at a time. Here, we do verification and write out the generated - // biblioref. + // key at a time. var ( - enc = json.NewEncoder(w) keyer = makeKeyFunc("\t", 1) grouper = func(g *zipkey.Group) error { var ( @@ -184,34 +182,20 @@ func ZippyRefsOpenLibrary(olr, refs io.Reader, w io.Writer) error { return err } result := Verify(pivot, re) - switch result.Status { - case StatusExact, StatusStrong: - if result.Reason == ReasonDOI { - continue - } - br := generateBiblioRef(re, pivot, result, "fuzzy") - if err := enc.Encode(br); err != nil { - return err - } - default: - // XXX: We want to add unmatched pieces as well; here? We - // probably want to do a single final pass to complete the - // dataset. - } + fmt.Printf("%s\t%s\t%s\t%s\t%s\n", + result.Status.Short(), + result.Reason.Short(), + cut(g.G0[0], "\t", 1), + pivot.Title, + re.Title) } return nil } ) - zipper := zipkey.New(olr, refs, keyer, grouper) + zipper := zipkey.New(releases, refs, keyer, grouper) return zipper.Run() } -func ZippyOpenLibraryMerge(ole, olw io.Reader, w io.Writer) error { - // XXX: augment on or the other schema with subtitles; maybe generate - // release schema right away. - return nil -} - // makeKeyFunc creates a function that can be used as keyFunc, selecting a // column from fields separated by sep; column is 1-indexed. func makeKeyFunc(sep string, column int) func(string) (string, error) { |