From 60a198f7ee5843a0f77b6dfb845c3b0413e83705 Mon Sep 17 00:00:00 2001 From: Nick White Date: Thu, 5 Sep 2019 22:20:35 +0100 Subject: Don't abort analysis if we encounter a hocr with no words, just skip it --- bookpipeline/cmd/bookpipeline/main.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'bookpipeline/cmd/bookpipeline/main.go') diff --git a/bookpipeline/cmd/bookpipeline/main.go b/bookpipeline/cmd/bookpipeline/main.go index 520311b..97f4109 100644 --- a/bookpipeline/cmd/bookpipeline/main.go +++ b/bookpipeline/cmd/bookpipeline/main.go @@ -156,6 +156,9 @@ func analyse(toanalyse chan string, up chan string, errc chan error, logger *log errc <- errors.New(fmt.Sprintf("Error retreiving confidence for %s: %s", path, err)) return } + if avg == 0 { + continue + } base := filepath.Base(path) codestart := strings.Index(base, "_bin") name := base[0:codestart] -- cgit v1.2.1-24-ge1ad