summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/hocr/lines.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/hocr/lines.go b/lib/hocr/lines.go
index 20c6550..74e8f9a 100644
--- a/lib/hocr/lines.go
+++ b/lib/hocr/lines.go
@@ -112,3 +112,20 @@ func GetLineDetails(hocrfn string) (line.Details, error) {
n := strings.Replace(filepath.Base(hocrfn), ".hocr", "", 1)
return parseLineDetails(h, img, n)
}
+
+func GetLineBasics(hocrfn string) (line.Details, error) {
+ var newlines line.Details
+
+ file, err := ioutil.ReadFile(hocrfn)
+ if err != nil {
+ return newlines, err
+ }
+
+ h, err := Parse(file)
+ if err != nil {
+ return newlines, err
+ }
+
+ n := strings.Replace(filepath.Base(hocrfn), ".hocr", "", 1)
+ return parseLineDetails(h, nil, n)
+}