serial

package
v0.0.0-...-a743e43 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeDocPageLocations

func MakeDocPageLocations(b *flatbuffers.Builder, dpl DocPageLocations) []byte

func MakeDocPositions

func MakeDocPositions(b *flatbuffers.Builder, doc DocPositions) []byte

func MakeSerialPdfIndex

func MakeSerialPdfIndex(b *flatbuffers.Builder, spi SerialPdfIndex) []byte

func MakeTextLocation

func MakeTextLocation(b *flatbuffers.Builder, loc TextLocation) []byte

func WriteSerialPdfIndex

func WriteSerialPdfIndex(spi SerialPdfIndex) []byte

WriteSerialPdfIndex

Types

type DocPageLocations

type DocPageLocations struct {
	Doc       uint64
	Page      uint32
	Locations []TextLocation
}
table DocPageLocations  {
	doc:       uint64;
	page:      uint32;
	locations: [TextLocation];
}

func ReadDocPageLocations

func ReadDocPageLocations(buf []byte) (DocPageLocations, error)

type DocPositions

type DocPositions struct {
	Path      string // Path of input PDF file.
	DocIdx    uint64 // Index into lState.fileList.
	PageNums  []uint32
	PageTexts []string
}

// DocPositions tracks the data that is used to index a PDF file.

table DocPositions {
	path:  string;                               // Path of input PDF file.
	doc_idx:  uint64;                            // Index into lState.fileList.
	page_nums:  [uint32];
	page_texts: [string];
}

func ReadDocPositions

func ReadDocPositions(buf []byte) (DocPositions, error)

func (DocPositions) String

func (doc DocPositions) String() string

type HashIndexPathDoc

type HashIndexPathDoc struct {
	Hash  string
	Index uint64
	Path  string
	Doc   DocPositions
}
table HashIndexPathDoc {
	hash: string;
	index: uint64;
	path: string;
	doc: DocPositions;
}

type SerialPdfIndex

type SerialPdfIndex struct {
	NumFiles uint32
	NumPages uint32
	BleveMem []byte
	HIPDs    []HashIndexPathDoc
}
table PdfIndex  {
	num_files:   uint32;
	num_pages:   uint32;
	index :     [byte];
	hipd:       [HashIndexPathDoc];
}

func ReadSerialPdfIndex

func ReadSerialPdfIndex(buf []byte) (SerialPdfIndex, error)

type TextLocation

type TextLocation struct {
	Start, End         uint32
	Llx, Lly, Urx, Ury float32
}
table TextLocation {
	offset:   uint32;
	llx: float32;
	lly: float32;
	urx: float32;
	ury: float32;
}

TextLocation describes the location of text on a page.

func ReadTextLocation

func ReadTextLocation(buf []byte) TextLocation

func (TextLocation) String

func (t TextLocation) String() string

Directories

Path Synopsis
cmd
locations
Code from flatbuffers tutorial https://rwinslow.com/posts/use-flatbuffers-in-golang/
Code from flatbuffers tutorial https://rwinslow.com/posts/use-flatbuffers-in-golang/

Jump to

Keyboard shortcuts

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