Skip to content

Commit

Permalink
Merge pull request #23 from GargantuaX/master
Browse files Browse the repository at this point in the history
OCR增加是否输出段落信息参数选项,参考文档:https://ai.baidu.com/ai-doc/OCR/zk3h7xz52
  • Loading branch information
cyjaysong authored Jan 23, 2021
2 parents 78bbd08 + 8107e20 commit 9acbeb9
Showing 1 changed file with 18 additions and 10 deletions.
28 changes: 18 additions & 10 deletions vision/ocr/param.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,17 @@ func LanguageType(lang string) RequestParam {
"JAP",
"KOR",
//以下选项为高精度OCR才支持的选项
"DAN", //丹麦语
"DUT", //荷兰语
"MAL", //马来语
"SWE", //瑞典语
"IND", //印尼语
"POL", //波兰语
"ROM", //罗马尼亚语
"TUR", //土耳其语
"GRE", //希腊语
"HUN", //匈牙利语
"auto_detect", //自动检测语言
"DAN", //丹麦语
"DUT", //荷兰语
"MAL", //马来语
"SWE", //瑞典语
"IND", //印尼语
"POL", //波兰语
"ROM", //罗马尼亚语
"TUR", //土耳其语
"GRE", //希腊语
"HUN", //匈牙利语
}

illegal := true
Expand Down Expand Up @@ -68,6 +69,13 @@ func WithProbability() RequestParam {
}
}

//是否输出段落信息
func WithParagraph() RequestParam {
return func(m map[string]interface{}) {
m["paragraph"] = true
}
}

//是否定位单字符位置,big:不定位单字符位置,默认值;small:定位单字符位置
func RecognizeGranularity() RequestParam {
return func(m map[string]interface{}) {
Expand Down

0 comments on commit 9acbeb9

Please sign in to comment.