summaryrefslogtreecommitdiff
path: root/cmd/rescribe/main.go
diff options
context:
space:
mode:
authorNick White <git@njw.name>2021-07-13 11:54:00 +0100
committerNick White <git@njw.name>2021-07-13 11:54:00 +0100
commit45b0c3ed61b1a7b7d18090f483c5d9ff9cddec7b (patch)
tree13de0f1a0ac47c38e172e4082e6345a4c511e1bf /cmd/rescribe/main.go
parente22c16ca84163636d674fb0935156f466169e1a3 (diff)
gofmt
Diffstat (limited to 'cmd/rescribe/main.go')
-rw-r--r--cmd/rescribe/main.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/cmd/rescribe/main.go b/cmd/rescribe/main.go
index 4404789..db8eb41 100644
--- a/cmd/rescribe/main.go
+++ b/cmd/rescribe/main.go
@@ -46,6 +46,7 @@ var tessdatazip []byte
const QueueTimeoutSecs = 2 * 60
const PauseBetweenChecks = 1 * time.Second
const LogSaveTime = 1 * time.Minute
+
var thresholds = []float64{0.1, 0.2, 0.3}
// null writer to enable non-verbose logging to be discarded
@@ -322,8 +323,8 @@ These training files are included in rescribe, and are always available:
}
// For simplicity, remove .binarised.pdf and rename .colour.pdf to .pdf
- _ = os.Remove(filepath.Join(savedir, bookname + ".binarised.pdf"))
- _ = os.Rename(filepath.Join(savedir, bookname + ".colour.pdf"), filepath.Join(savedir, bookname + ".pdf"))
+ _ = os.Remove(filepath.Join(savedir, bookname+".binarised.pdf"))
+ _ = os.Rename(filepath.Join(savedir, bookname+".colour.pdf"), filepath.Join(savedir, bookname+".pdf"))
}
func addTxtVersion(hocrfn string) error {
@@ -342,7 +343,7 @@ func addTxtVersion(hocrfn string) error {
for _, v := range thresholds {
basefn = strings.TrimSuffix(basefn, fmt.Sprintf("_bin%.1f.hocr", v))
}
- fn := filepath.Join(dir, "text", basefn + ".txt")
+ fn := filepath.Join(dir, "text", basefn+".txt")
err = ioutil.WriteFile(fn, []byte(t), 0644)
if err != nil {