From 561d8461cbe19316762489cd7b04f95b9014bcda Mon Sep 17 00:00:00 2001 From: Nick White Date: Thu, 5 Sep 2019 22:24:37 +0100 Subject: Handle no words found error in a better way so any page that is actually 0 confidence is recognised --- lib/hocr/hocr.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/hocr/hocr.go') diff --git a/lib/hocr/hocr.go b/lib/hocr/hocr.go index 052aa19..dcd0494 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, nil + return 0, errors.New("No words found") } return total / num, nil } -- cgit v1.2.1-24-ge1ad