diff options
-rw-r--r-- | bookpipeline/cmd/bookpipeline/main.go | 3 | ||||
-rw-r--r-- | lib/hocr/hocr.go | 2 |
2 files changed, 4 insertions, 1 deletions
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] diff --git a/lib/hocr/hocr.go b/lib/hocr/hocr.go index dcd0494..052aa19 100644 --- a/lib/hocr/hocr.go +++ b/lib/hocr/hocr.go @@ -123,7 +123,7 @@ func GetAvgConf(hocrfn string) (float64, error) { } } if num == 0 { - return 0, errors.New("No words found") + return 0, nil } return total / num, nil } |