Documentation ¶
Index ¶
- type BoundingBox
- func (bb *BoundingBox) Bottom() float32
- func (bb *BoundingBox) Height() float32
- func (bb *BoundingBox) HorizontalCenter() float32
- func (bb *BoundingBox) Intersection(other *BoundingBox) *BoundingBox
- func (bb *BoundingBox) Left() float32
- func (bb *BoundingBox) Right() float32
- func (bb *BoundingBox) Top() float32
- func (bb *BoundingBox) Union(other *BoundingBox) *BoundingBox
- func (bb *BoundingBox) VerticalCenter() float32
- func (bb *BoundingBox) Width() float32
- type Cell
- type Content
- type Document
- type Field
- type FieldKey
- type FieldValue
- type Form
- type Geometry
- type JSONResponse
- type Line
- type Orientation
- type Page
- func (p *Page) Blocks() []types.Block
- func (p *Page) Form() *Form
- func (p *Page) Geometry() *Geometry
- func (p *Page) ID() string
- func (p *Page) LineAtIndex(i int) (*Line, error)
- func (p *Page) LineCount() int
- func (p *Page) Lines() []*Line
- func (p *Page) TableAtIndex(i int) *Table
- func (p *Page) TableCount() int
- func (p *Page) Tables() []*Table
- func (p *Page) Text() string
- type Point
- type ResponsePage
- type Row
- type SelectionElement
- type Table
- type Word
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BoundingBox ¶
type BoundingBox struct {
// contains filtered or unexported fields
}
BoundingBox represents the bounding box of a geometry.
func NewBoundingBox ¶
func NewBoundingBox(boundingBox *types.BoundingBox) *BoundingBox
NewBoundingBox creates a new BoundingBox instance.
func (*BoundingBox) Bottom ¶
func (bb *BoundingBox) Bottom() float32
Bottom returns the bottom coordinate of the bounding box.
func (*BoundingBox) Height ¶
func (bb *BoundingBox) Height() float32
Height returns the height of the bounding box.
func (*BoundingBox) HorizontalCenter ¶
func (bb *BoundingBox) HorizontalCenter() float32
HorizontalCenter returns the horizontal center coordinate of the bounding box.
func (*BoundingBox) Intersection ¶
func (bb *BoundingBox) Intersection(other *BoundingBox) *BoundingBox
Intersection returns a new bounding box that represents the intersection of two bounding boxes.
func (*BoundingBox) Left ¶
func (bb *BoundingBox) Left() float32
Left returns the left coordinate of the bounding box.
func (*BoundingBox) Right ¶
func (bb *BoundingBox) Right() float32
Right returns the right coordinate of the bounding box.
func (*BoundingBox) Top ¶
func (bb *BoundingBox) Top() float32
Top returns the top coordinate of the bounding box.
func (*BoundingBox) Union ¶
func (bb *BoundingBox) Union(other *BoundingBox) *BoundingBox
Union returns a new bounding box that represents the union of two bounding boxes.
func (*BoundingBox) VerticalCenter ¶
func (bb *BoundingBox) VerticalCenter() float32
VerticalCenter returns the vertical center coordinate of the bounding box.
func (*BoundingBox) Width ¶
func (bb *BoundingBox) Width() float32
Width returns the width of the bounding box.
type Cell ¶
type Cell struct {
// contains filtered or unexported fields
}
func (*Cell) ColumnIndex ¶
func (*Cell) ColumnSpan ¶
func (*Cell) Confidence ¶
func (c *Cell) Confidence() float32
Confidence returns the confidence level of the content.
type Content ¶
type Content interface { ID() string Confidence() float32 Geometry() *Geometry Block() types.Block }
Content is an interface for document content elements.
type Document ¶
type Document struct {
// contains filtered or unexported fields
}
func NewDocument ¶
func NewDocument(responsePages ...*ResponsePage) *Document
type Field ¶
type Field struct {
// contains filtered or unexported fields
}
func (*Field) Confidence ¶
func (*Field) Value ¶
func (f *Field) Value() *FieldValue
type FieldKey ¶
type FieldKey struct {
// contains filtered or unexported fields
}
func NewFieldKey ¶
func (*FieldKey) Confidence ¶
func (c *FieldKey) Confidence() float32
Confidence returns the confidence level of the content.
type FieldValue ¶
type FieldValue struct {
// contains filtered or unexported fields
}
func NewFieldValue ¶
func (*FieldValue) Confidence ¶
func (c *FieldValue) Confidence() float32
Confidence returns the confidence level of the content.
func (*FieldValue) Geometry ¶
func (c *FieldValue) Geometry() *Geometry
Geometry returns the geometry information of the content.
func (*FieldValue) String ¶
func (fv *FieldValue) String() string
func (*FieldValue) Text ¶
func (fv *FieldValue) Text() string
type Form ¶
type Form struct {
// contains filtered or unexported fields
}
func (*Form) FieldByKey ¶
type Geometry ¶
type Geometry struct {
// contains filtered or unexported fields
}
Geometry represents the geometric properties of an element.
func NewGeometry ¶
NewGeometry creates a new Geometry instance.
func (*Geometry) BoundingBox ¶
func (g *Geometry) BoundingBox() *BoundingBox
BoundingBox returns the bounding box of the geometry.
func (*Geometry) Orientation ¶
func (g *Geometry) Orientation() *Orientation
Orientation returns the orientation of the geometry.
type JSONResponse ¶
type JSONResponse struct { DocumentMetadata struct { Pages *int32 `json:"Pages"` } `json:"DocumentMetadata"` Blocks []struct { BlockType string `json:"BlockType"` ColumnIndex *int32 `json:"ColumnIndex"` ColumnSpan *int32 `json:"ColumnSpan"` ID *string `json:"Id"` Confidence *float32 `json:"Confidence"` Text *string `json:"Text"` EntityTypes []string `json:"EntityTypes"` Geometry struct { BoundingBox struct { Width float32 `json:"Width"` Height float32 `json:"Height"` Left float32 `json:"Left"` Top float32 `json:"Top"` } `json:"BoundingBox"` Polygon []struct { X float32 `json:"X"` Y float32 `json:"Y"` } `json:"Polygon"` } `json:"Geometry"` Relationships []struct { Type string `json:"Type"` IDs []string `json:"Ids"` } `json:"Relationships"` } `json:"Blocks"` }
type Line ¶
type Line struct {
// contains filtered or unexported fields
}
Line represents a line of text in the document.
func (*Line) Confidence ¶
func (c *Line) Confidence() float32
Confidence returns the confidence level of the content.
type Orientation ¶
type Orientation struct {
// contains filtered or unexported fields
}
Orientation represents the orientation of a geometric element.
func NewOrientation ¶
func NewOrientation(point0, point1 *Point) *Orientation
NewOrientation creates a new Orientation instance.
func (*Orientation) Degrees ¶
func (o *Orientation) Degrees() float32
Degrees returns the orientation in degrees.
func (*Orientation) Radians ¶
func (o *Orientation) Radians() float32
Radians returns the orientation in radians.
type Page ¶
type Page struct {
// contains filtered or unexported fields
}
Page represents a page in the document.
func (*Page) TableAtIndex ¶
func (*Page) TableCount ¶
type Point ¶
type Point struct {
// contains filtered or unexported fields
}
Point represents a 2D point.
type ResponsePage ¶
func NewResponsePageFromJSON ¶
func NewResponsePageFromJSON(data []byte) (*ResponsePage, error)
type Row ¶
type Row struct {
// contains filtered or unexported fields
}
func (Row) Confidence ¶
func (c Row) Confidence() float32
Confidence returns the confidence level of the content.
type SelectionElement ¶
type SelectionElement struct {
// contains filtered or unexported fields
}
SelectionElement represents a selectable element in the document.
func NewSelectionElement ¶
func NewSelectionElement(block types.Block) *SelectionElement
NewSelectionElement creates a new SelectionElement instance.
func (*SelectionElement) Confidence ¶
func (c *SelectionElement) Confidence() float32
Confidence returns the confidence level of the content.
func (*SelectionElement) Geometry ¶
func (c *SelectionElement) Geometry() *Geometry
Geometry returns the geometry information of the content.
func (*SelectionElement) ID ¶
func (c *SelectionElement) ID() string
ID returns the ID of the content.
func (*SelectionElement) IsSelected ¶
func (se *SelectionElement) IsSelected() bool
IsSelected checks if the element is selected.
func (*SelectionElement) Status ¶
func (se *SelectionElement) Status() types.SelectionStatus
Status returns the selection status of the element.
type Table ¶
type Table struct {
// contains filtered or unexported fields
}
func (Table) Confidence ¶
func (c Table) Confidence() float32
Confidence returns the confidence level of the content.
type Word ¶
type Word struct {
// contains filtered or unexported fields
}
Word represents a word in the document.
func (*Word) Confidence ¶
func (c *Word) Confidence() float32
Confidence returns the confidence level of the content.
func (*Word) Geometry ¶
func (c *Word) Geometry() *Geometry
Geometry returns the geometry information of the content.
func (*Word) IsHandwriting ¶
IsHandwriting checks if the word is handwriting.