model

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Coordinate

type Coordinate struct {
	Left   int
	Top    int
	Right  int
	Bottom int
}

Coordinate captures bounding box information.

type DiffResultSummary

type DiffResultSummary struct {
	HasDiff       bool     `json:"has_diff"`
	ExtraPages    int      `json:"extra_pages"`
	DiffPageCount int      `json:"diff_page_count"`
	MappingScheme string   `json:"mapping_scheme"`
	Preview       []string `json:"preview,omitempty"`
}

type DiffSummary

type DiffSummary struct {
	OCRDiff   *DiffResultSummary `json:"ocr_diff,omitempty"`
	TableDiff *DiffResultSummary `json:"table_diff,omitempty"`
	Notes     []string           `json:"notes,omitempty"`
}

DiffSummary 汇总 diff/fuzzy 相关信息。

type Meta

type Meta struct {
	ProcessedPaths []string
	Duration       time.Duration
	Warnings       []string
	Diagnostics    map[string]any
}

Meta captures execution metadata.

type OCRPayload

type OCRPayload struct {
	Files               []string
	RawResponses        [][]byte
	HTMLPages           []string
	CombinedHTML        string
	RecognizedText      string
	NormalizedText      string
	Coordinates         []Coordinate
	TextBoxes           []TextBox
	PageTexts           []string
	NormalizedPageTexts []string
}

OCRPayload carries raw provider responses for later parsing or merging.

type OperationKind

type OperationKind string

OperationKind indicates which OCR pipeline to invoke.

const (
	OperationKindAny   OperationKind = "any"
	OperationKindOCR   OperationKind = "ocr"
	OperationKindTable OperationKind = "table"
	OperationKindStamp OperationKind = "stamp"
)

type Request

type Request struct {
	Paths     []string
	MaxPages  int
	Options   map[string]any
	Meta      map[string]string
	CreatedAt time.Time
}

Request defines the standard input for a recognition workflow.

type Response

type Response struct {
	Meta    Meta
	Payload any
	Diff    *DiffSummary
}

Response is the generic output returned by a pipeline.

type StampDetail

type StampDetail struct {
	Text     string
	Type     string
	Shape    string
	Color    string
	Position []int
}

StampDetail holds metadata for a single detected stamp.

type StampPage

type StampPage struct {
	Index int
	Stamp []StampDetail
}

StampPage holds detection details per page.

type StampPayload

type StampPayload struct {
	Pages []StampPage
	Raw   [][]byte
	Files []string
}

StampPayload collects stamp detection details.

type StampResponse

type StampResponse struct {
	Meta    Meta
	Payload StampPayload
}

StampResponse is the specialized response for stamp detection.

type TablePage

type TablePage struct {
	Index       int
	Width       int
	Height      int
	Recognized  string
	Coordinates []Coordinate
}

TablePage captures the parsed payload for a single table page.

type TablePayload

type TablePayload struct {
	Pages                  []TablePage
	Raw                    [][]byte
	Files                  []string
	HTMLPages              []string
	CombinedHTML           string
	Text                   []string
	NormalizedTexts        []string
	NormalizedCombinedText string
}

TablePayload represents table structured recognition result.

type TableResponse

type TableResponse struct {
	Meta    Meta
	Payload TablePayload
	Diff    *DiffSummary
}

TableResponse is the specialized response for table OCR requests.

type TextBox

type TextBox struct {
	Page       int
	Text       string
	Coordinate Coordinate
	PageWidth  int
	PageHeight int
	Confidence float64
	Level      string
}

TextBox associates recognized text with a bounding box on a page.

Jump to

Keyboard shortcuts

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