summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorNick White <git@njw.name>2019-09-05 22:24:37 +0100
committerNick White <git@njw.name>2019-09-05 22:42:30 +0100
commit561d8461cbe19316762489cd7b04f95b9014bcda (patch)
tree7d3409f3279174cab7707b024353d602d3a5f18e /lib
parent60a198f7ee5843a0f77b6dfb845c3b0413e83705 (diff)
Handle no words found error in a better way so any page that is actually 0 confidence is recognised
Diffstat (limited to 'lib')
-rw-r--r--lib/hocr/hocr.go2
1 files changed, 1 insertions, 1 deletions
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
}