page

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 28, 2018 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// MIMEType defines the mime-type of page XML files.
	// See: https://github.com/PRImA-Research-Lab/PAGE-XML
	MIMEType = "application/alto+xml"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Line added in v0.4.0

type Line struct {
	ID string
	// contains filtered or unexported fields
}

Line represents a line of text in the page XML file.

func (Line) FindWordByID added in v0.4.0

func (l Line) FindWordByID(id string) (Word, bool)

FindWordByID searches for a line with the given ID.

func (Line) TextEquivUnicodeAt added in v0.4.0

func (l Line) TextEquivUnicodeAt(pos int) (string, bool)

TextEquivUnicodeAt returns the i-th TextEquiv/Unicode entry (indexing is zero-based).

func (Line) Words added in v0.4.0

func (l Line) Words() []Word

Words returns all words in a line.

type Page

type Page struct {
	// contains filtered or unexported fields
}

Page represents an open page XML file.

func Open

func Open(path string) (Page, error)

Open opens a page XML file

func (Page) FindRegionByID added in v0.4.0

func (p Page) FindRegionByID(id string) (Region, bool)

FindRegionByID returns the region with the given refID.

func (Page) Regions

func (p Page) Regions() []Region

Regions returns a slice with all RegionRefIndexed elements

type Region

type Region struct {
	ID string
	// contains filtered or unexported fields
}

Region defines a text region in the page XML file.

func (Region) FindLineByID

func (r Region) FindLineByID(id string) (Line, bool)

FindLineByID searches for a line with the given ID.

func (Region) Lines

func (r Region) Lines() []Line

Lines Returns all lines in a region.

func (Region) TextEquivUnicodeAt

func (r Region) TextEquivUnicodeAt(pos int) (string, bool)

TextEquivUnicodeAt returns the i-th TextEquiv/Unicode entry (indexing is zero-based).

type Word

type Word struct {
	ID string
	// contains filtered or unexported fields
}

Word represents a word on a line.

func (Word) TextEquivUnicodeAt

func (w Word) TextEquivUnicodeAt(pos int) (string, bool)

TextEquivUnicodeAt returns the i-th TextEquiv/Unicode element (the indexing is zero-based).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL