From aee651e282c7a9aecd8f25a5e306cdd695325068 Mon Sep 17 00:00:00 2001 From: Nick White Date: Wed, 11 Dec 2019 15:47:35 +0000 Subject: Clean up and correct book name parsing in the pipeline, and update usage of getpipelinebook --- cmd/bookpipeline/main.go | 17 +++-------------- cmd/getpipelinebook/main.go | 6 +++--- 2 files changed, 6 insertions(+), 17 deletions(-) (limited to 'cmd') diff --git a/cmd/bookpipeline/main.go b/cmd/bookpipeline/main.go index 0ffb4b2..425b6a6 100644 --- a/cmd/bookpipeline/main.go +++ b/cmd/bookpipeline/main.go @@ -454,13 +454,7 @@ func ocrPage(msg bookpipeline.Qmsg, conn Pipeliner, process func(chan string, ch errc := make(chan error) msgparts := strings.Split(msg.Body, " ") - bookparts := strings.Split(msgparts[0], "/") - var bookname string - if len(bookparts) > 1 { - bookname = filepath.Dir(msgparts[0]) - } else { - bookname = msgparts[0] - } + bookname := filepath.Dir(msgparts[0]) if len(msgparts) > 1 { process = ocr(msgparts[1]) } @@ -538,13 +532,8 @@ func processBook(msg bookpipeline.Qmsg, conn Pipeliner, process func(chan string errc := make(chan error) msgparts := strings.Split(msg.Body, " ") - bookparts := strings.Split(msgparts[0], "/") - var bookname string - if len(bookparts) > 1 { - bookname = filepath.Dir(msgparts[0]) - } else { - bookname = msgparts[0] - } + bookname := msgparts[0] + var training string if len(msgparts) > 1 { training = msgparts[1] diff --git a/cmd/getpipelinebook/main.go b/cmd/getpipelinebook/main.go index faf5383..fc6170c 100644 --- a/cmd/getpipelinebook/main.go +++ b/cmd/getpipelinebook/main.go @@ -15,9 +15,9 @@ const usage = `Usage: getpipelinebook [-a] [-c] [-v] bookname Downloads the pipeline results for a book. -By default this downloads the best hOCR version for each page with -the corresponding binarised image, and the best, conf and graph.png -analysis files. +By default this downloads the best hOCR version for each page, the +binarised and (if available) colour PDF, and the best, conf and +graph.png analysis files. ` // null writer to enable non-verbose logging to be discarded -- cgit v1.2.1-24-ge1ad