Documentation ¶
Index ¶
- Variables
- type DocumentReport
- type Node
- func (n *Node) AsProto(unit geometry.LengthUnit) *reportpb.Node
- func (n *Node) Bounds() geometry.Rect
- func (n *Node) FeaturePosition(feature sketchpb.NodeFeature) (geometry.Point, error)
- func (n *Node) Name() string
- func (n *Node) SearchAreas() []geometry.Rect
- func (n *Node) Tags() []string
- func (n *Node) Text() string
- func (n *Node) TextMatch() *TextMatch
- func (n *Node) Valid() bool
- type PageReport
- func (p *PageReport) AsProto(unit geometry.LengthUnit) *reportpb.Page
- func (p *PageReport) NodeByName(name string) *Node
- func (p *PageReport) NodeFeaturePosition(name string, feature sketchpb.NodeFeature) (geometry.Point, error)
- func (p *PageReport) Nodes() []*Node
- func (p *PageReport) Number() int
- func (p *PageReport) Size() geometry.Size
- type Sketch
- type TextMatch
- func (m *TextMatch) Group(idx int) *TextMatchGroup
- func (m *TextMatch) Groups() []TextMatchGroup
- func (m *TextMatch) MustGroup(idx int) TextMatchGroup
- func (m *TextMatch) MustNamed(name string) TextMatchGroup
- func (m *TextMatch) Named(name string) *TextMatchGroup
- func (m *TextMatch) Pattern() string
- type TextMatchGroup
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrIncompleteConfig = sketcherror.ErrIncompleteConfig ErrBadConfig = sketcherror.ErrBadConfig ErrNodePositionUnknown = errors.New("node position unknown") )
Functions ¶
This section is empty.
Types ¶
type DocumentReport ¶
type DocumentReport struct {
// contains filtered or unexported fields
}
DocumentReport is the result of a document analysis.
func (*DocumentReport) AsProto ¶
func (r *DocumentReport) AsProto(unit geometry.LengthUnit) *reportpb.Document
func (*DocumentReport) Pages ¶
func (r *DocumentReport) Pages() []*PageReport
func (*DocumentReport) Tags ¶
func (r *DocumentReport) Tags() []string
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
func (*Node) FeaturePosition ¶
func (*Node) SearchAreas ¶
type PageReport ¶
type PageReport struct {
// contains filtered or unexported fields
}
func (*PageReport) AsProto ¶
func (p *PageReport) AsProto(unit geometry.LengthUnit) *reportpb.Page
func (*PageReport) NodeByName ¶
func (p *PageReport) NodeByName(name string) *Node
func (*PageReport) NodeFeaturePosition ¶
func (p *PageReport) NodeFeaturePosition(name string, feature sketchpb.NodeFeature) (geometry.Point, error)
func (*PageReport) Nodes ¶
func (p *PageReport) Nodes() []*Node
func (*PageReport) Number ¶
func (p *PageReport) Number() int
Number returns the 1-based page number.
func (*PageReport) Size ¶
func (p *PageReport) Size() geometry.Size
type Sketch ¶
type Sketch struct {
// contains filtered or unexported fields
}
func CompileFromTextproto ¶
func (*Sketch) AnalyzeDocument ¶
func (*Sketch) AnalyzePage ¶
func (s *Sketch) AnalyzePage(p *dossier.Page) (*PageReport, error)
func (*Sketch) AnalyzePages ¶
func (s *Sketch) AnalyzePages(pages []*dossier.Page) ([]*PageReport, error)
type TextMatch ¶
type TextMatch struct {
// contains filtered or unexported fields
}
TextMatch captures information about a regular expression match in a string.
func (*TextMatch) Group ¶
func (m *TextMatch) Group(idx int) *TextMatchGroup
Group returns a subgroup by index or nil if it's not captured.
func (*TextMatch) Groups ¶
func (m *TextMatch) Groups() []TextMatchGroup
Groups returns a slice with all subgroups of the match.
func (*TextMatch) MustGroup ¶
func (m *TextMatch) MustGroup(idx int) TextMatchGroup
MustGroup returns a subgroup by index or panics if it's not captured.
func (*TextMatch) MustNamed ¶
func (m *TextMatch) MustNamed(name string) TextMatchGroup
Group returns a subgroup by name or panics if it's not captured.
func (*TextMatch) Named ¶
func (m *TextMatch) Named(name string) *TextMatchGroup
Group returns a subgroup by name or nil if it's not captured.
type TextMatchGroup ¶
type TextMatchGroup struct { // Capture group name. Empty if no name is set using (?P<...>). Name string // Zero-based start and end offset of the group in the original string. Start int End int // Text captured by the group. Text string }
func (*TextMatchGroup) AsProto ¶
func (g *TextMatchGroup) AsProto() *reportpb.TextMatchGroup
Click to show internal directories.
Click to hide internal directories.