diff options
-rw-r--r-- | cmd/dehyphenate/main.go | 18 | ||||
-rw-r--r-- | cmd/dlgbook/main.go | 6 | ||||
-rw-r--r-- | cmd/iiifdownloader/main.go | 6 |
3 files changed, 22 insertions, 8 deletions
diff --git a/cmd/dehyphenate/main.go b/cmd/dehyphenate/main.go index 284fc1a..4d48e08 100644 --- a/cmd/dehyphenate/main.go +++ b/cmd/dehyphenate/main.go @@ -77,15 +77,17 @@ func main() { log.Fatal(err) } - for i, l := range h.Lines { - w := l.Words[len(l.Words)-1] - if len(w.Chars) == 0 { - if len(w.Text) > 0 && w.Text[len(w.Text)-1] == '-' { - h.Lines[i].Words[len(l.Words)-1].Text = w.Text[0:len(w.Text)-1] + h.Lines[i+1].Words[0].Text - h.Lines[i+1].Words[0].Text = "" + for _, p := range h.Pages { + for i, l := range p.Lines { + w := l.Words[len(l.Words)-1] + if len(w.Chars) == 0 { + if len(w.Text) > 0 && w.Text[len(w.Text)-1] == '-' { + p.Lines[i].Words[len(l.Words)-1].Text = w.Text[0:len(w.Text)-1] + p.Lines[i+1].Words[0].Text + p.Lines[i+1].Words[0].Text = "" + } + } else { + log.Printf("TODO: handle OcrChar") } - } else { - log.Printf("TODO: handle OcrChar") } } } else { diff --git a/cmd/dlgbook/main.go b/cmd/dlgbook/main.go index 6518006..3c8870e 100644 --- a/cmd/dlgbook/main.go +++ b/cmd/dlgbook/main.go @@ -1,3 +1,9 @@ +// Copyright 2021 Nick White. +// Use of this source code is governed by the GPLv3 +// license that can be found in the LICENSE file. + +// dlgbook is a wrapper around getgbook which gets metadata and uses +// it to save to a specially formatted directory package main import ( diff --git a/cmd/iiifdownloader/main.go b/cmd/iiifdownloader/main.go index 87bd9a7..a218c5a 100644 --- a/cmd/iiifdownloader/main.go +++ b/cmd/iiifdownloader/main.go @@ -1,3 +1,9 @@ +// Copyright 2020-2021 Nick White. +// Use of this source code is governed by the GPLv3 +// license that can be found in the LICENSE file. + +// iiifdownloader attempts to download every page of a IIIF book in +// the best available quality, given a manifest url package main import ( |