From 23c1b47eb42ef8de6f5d5dd8e4afb80e8bd17497 Mon Sep 17 00:00:00 2001
From: Nick White <git@njw.name>
Date: Wed, 11 Dec 2019 15:01:17 +0000
Subject: Add ability to set a different training for the ocr job

---
 cmd/booktopipeline/main.go | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

(limited to 'cmd/booktopipeline')

diff --git a/cmd/booktopipeline/main.go b/cmd/booktopipeline/main.go
index 264b6ab..425c41f 100644
--- a/cmd/booktopipeline/main.go
+++ b/cmd/booktopipeline/main.go
@@ -10,7 +10,7 @@ import (
 	"rescribe.xyz/bookpipeline"
 )
 
-const usage = `Usage: booktopipeline [-prebinarised] [-v] bookdir [bookname]
+const usage = `Usage: booktopipeline [-t training] [-prebinarised] [-v] bookdir [bookname]
 
 Uploads the book in bookdir to the S3 'inprogress' bucket and adds it
 to the 'preprocess' SQS queue, or the 'wipeonly' queue if the
@@ -52,6 +52,7 @@ func (f fileWalk) Walk(path string, info os.FileInfo, err error) error {
 func main() {
 	verbose := flag.Bool("v", false, "Verbose")
 	wipeonly := flag.Bool("prebinarised", false, "Prebinarised: only preprocessing will be to wipe")
+	training := flag.String("t", "", "Training file to use")
 
 	flag.Usage = func() {
 		fmt.Fprintf(flag.CommandLine.Output(), usage)
@@ -111,6 +112,9 @@ func main() {
 		}
 	}
 
+	if *training != "" {
+		bookname = bookname + " " + *training
+	}
 	err = conn.AddToQueue(qid, bookname)
 	if err != nil {
 		log.Fatalln("Error adding book to queue:", err)
-- 
cgit v1.2.1-24-ge1ad