Documentation
¶
Index ¶
- func FuzzyLocateText(recognizedText, targetText string, ...) []fuzzy.Candidate
- func PageDiffScore(a, b OCRPage) int
- func PageDiffScoreOrigTable(a, b TPage) int
- type DiffResult
- type ExtraPage
- type LineDiff
- type OCRChar
- type OCRLine
- type OCRPage
- type OCRResponse
- type PageDiff
- type TLine
- type TPage
- type Table
- type TableCell
- type TableDiffResult
- type TablePageDiff
- type TableResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FuzzyLocateText ¶
func FuzzyLocateText(recognizedText, targetText string, segLength, margin, thresholdStart, thresholdEnd, overallThreshold, boundaryTolerance int, removePunct bool) []fuzzy.Candidate
FuzzyLocateText 在识别文本中查找与目标文本相近的位置。
func PageDiffScore ¶
func PageDiffScoreOrigTable ¶
Types ¶
type DiffResult ¶
type DiffResult struct {
Valid bool `json:"valid"`
HasDiff bool `json:"has_diff"`
PageDiffs []PageDiff `json:"page_diffs"`
ExtraPages []ExtraPage `json:"extra_pages"`
MappingScheme string `json:"mapping_scheme"`
}
func CompareOCRJSON ¶
func CompareOCRJSON(orig, ret []byte) (DiffResult, error)
func CompareOCRResponses ¶
func CompareOCRResponses(orig, ret OCRResponse) DiffResult
type OCRLine ¶
type OCRLine struct {
Angle int `json:"angle"`
Text string `json:"text"`
Score float64 `json:"score"`
Direction int `json:"direction,omitempty"`
Handwritten int `json:"handwritten,omitempty"`
Position []int `json:"position,omitempty"`
Type string `json:"type,omitempty"`
CharCandidates [][]string `json:"char_candidates,omitempty"`
CharCandidatesScore [][]float64 `json:"char_candidates_score,omitempty"`
CharCenters [][]int `json:"char_centers,omitempty"`
CharPositions [][]int `json:"char_positions,omitempty"`
CharScores []float64 `json:"char_scores,omitempty"`
}
type OCRResponse ¶
type OCRResponse struct {
Code int `json:"code"`
Message string `json:"message"`
Result struct {
Pages []OCRPage `json:"pages"`
} `json:"result"`
}
func ParseOCRResponse ¶
func ParseOCRResponse(data []byte) (*OCRResponse, error)
type TLine ¶
type TLine struct {
Angle int `json:"angle"`
Text string `json:"text"`
Direction int `json:"direction"`
Handwritten int `json:"handwritten"`
Position []int `json:"position"`
Score float64 `json:"score"`
Type string `json:"type"`
CharCandidates [][]string `json:"char_candidates,omitempty"`
CharCandidatesScore [][]float64 `json:"char_candidates_score,omitempty"`
CharPositions [][]int `json:"char_positions,omitempty"`
}
type TableDiffResult ¶
type TableDiffResult struct {
Valid bool `json:"valid"`
HasDiff bool `json:"has_diff"`
PageDiffs []TablePageDiff `json:"page_diffs"`
ExtraPages []ExtraPage `json:"extra_pages"`
MappingScheme string `json:"mapping_scheme"`
}
func CompareTableJSON ¶
func CompareTableJSON(orig, ret []byte) (TableDiffResult, error)
func CompareTableResponses ¶
func CompareTableResponses(orig, ret TableResponse) TableDiffResult
type TablePageDiff ¶
type TableResponse ¶
type TableResponse struct {
Code int `json:"code"`
Msg string `json:"message"`
Result struct {
Pages []TPage `json:"pages"`
} `json:"result"`
}
func ParseTableResponse ¶
func ParseTableResponse(data []byte) (*TableResponse, error)
Click to show internal directories.
Click to hide internal directories.