ocr

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2022 License: MIT Imports: 10 Imported by: 0

README

OCR 云码

OCR 采用云码提供的 api

开发文档: https://www.yunmaiocr.com/doc

OCR 类型

云码对不同的 OCR 类型提供了相应的服务

服务类型需在 type 字段指定

  1. 数英汉字类型

    通用数英1-4位 10110

    通用数英5-8位 10111

    通用数英9~11位 10112

    通用数英12位及以上 10113

    通用数英1~6位plus 10103

    定制-数英5位~qcs 9001

    定制-纯数字4位 193

  2. 中文类型

    通用中文字符1~2位 10114

    通用中文字符 3~5位 10115

    通用中文字符6~8位 10116

    通用中文字符9位及以上 10117

    定制-XX西游苦行中文字符 10107

  3. 计算类型

    通用数字计算题 50100

    通用中文计算题 50101

    定制-计算题 cni 452

其他

详细文档: https://www.jfbym.com/demo/

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnsupportOCRType     = errors.New("ocr type is unsupported")
	ErrUnsupportCaptchaType = errors.New("ocr parse arg type is unsupported")
)
View Source
var DefaultType = Common

Functions

func Parse

func Parse(captcha interface{}) (string, error)

func SetToken

func SetToken(t string)

SetToken sets the token for later usage.

Types

type CommonTypeResponse

type CommonTypeResponse struct {
	Msg  string `json:"msg"`
	Code int64  `json:"code"`
	Data Data   `json:"data"`
}

type Data

type Data struct {
	Code       int64   `json:"code"`
	Data       string  `json:"data"`
	Time       float64 `json:"time"`
	UniqueCode string  `json:"unique_code"`
}

type YunmaOCRType

type YunmaOCRType int
const (
	Common YunmaOCRType = iota + 1
	Slide
	SinSlide
	TrafficSlide
	Click
	Rotate
	Google
	Hcaptcha
	FunCaptcha
)

func (YunmaOCRType) String

func (i YunmaOCRType) String() string

Jump to

Keyboard shortcuts

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