mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-18 15:40:12 +01:00
🎨 OCR 结果剔除不可见字符
This commit is contained in:
parent
ca2a27c964
commit
6d4aa07bc7
1 changed files with 1 additions and 3 deletions
|
|
@ -89,9 +89,7 @@ func Tesseract(imgAbsPath string) string {
|
|||
}
|
||||
|
||||
ret := string(output)
|
||||
ret = strings.ReplaceAll(ret, "\r", "")
|
||||
ret = strings.ReplaceAll(ret, "\n", "")
|
||||
ret = strings.ReplaceAll(ret, "\t", " ")
|
||||
ret = gulu.Str.RemoveInvisible(ret)
|
||||
reg := regexp.MustCompile("\\s{2,}")
|
||||
ret = reg.ReplaceAllString(ret, " ")
|
||||
msg := fmt.Sprintf("OCR [%s] [%s]", info.Name(), ret)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue