From a7381838fa51e4ad62d76b8b5a013047969718a8 Mon Sep 17 00:00:00 2001 From: Martin Czygan Date: Tue, 30 Mar 2021 02:38:42 +0200 Subject: generete a doi list --- skate/cmd/skate-biblioref-from-wikipedia/main.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'skate/cmd') diff --git a/skate/cmd/skate-biblioref-from-wikipedia/main.go b/skate/cmd/skate-biblioref-from-wikipedia/main.go index 61b590e..86fba1a 100644 --- a/skate/cmd/skate-biblioref-from-wikipedia/main.go +++ b/skate/cmd/skate-biblioref-from-wikipedia/main.go @@ -2,6 +2,7 @@ package main import ( "flag" + "fmt" "log" "os" "runtime" @@ -25,12 +26,13 @@ func main() { if err := json.Unmarshal(p, &w); err != nil { return nil, err } - b, err := json.Marshal(w.ParseIDList()) - if err != nil { - return nil, err + idl := w.ParseIDList() + if idl.DOI == "" { + return nil, nil } - b = append(b, bytesNewline...) - return b, nil + s := fmt.Sprintf("%s\t%s\n", idl.DOI, string(p)) + return []byte(s), nil + }) pp.NumWorkers = *numWorkers pp.BatchSize = *batchSize -- cgit v1.2.3