diff options
author | Nick White <git@njw.name> | 2019-12-11 15:47:35 +0000 |
---|---|---|
committer | Nick White <git@njw.name> | 2019-12-11 15:47:35 +0000 |
commit | aee651e282c7a9aecd8f25a5e306cdd695325068 (patch) | |
tree | 8f12712ef74365185914f29ac557f1bf09005bc8 | |
parent | 23c1b47eb42ef8de6f5d5dd8e4afb80e8bd17497 (diff) |
Clean up and correct book name parsing in the pipeline, and update usage of getpipelinebook
-rw-r--r-- | cmd/bookpipeline/main.go | 17 | ||||
-rw-r--r-- | cmd/getpipelinebook/main.go | 6 |
2 files changed, 6 insertions, 17 deletions
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 |