mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-18 07:30: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 := string(output)
|
||||||
ret = strings.ReplaceAll(ret, "\r", "")
|
ret = gulu.Str.RemoveInvisible(ret)
|
||||||
ret = strings.ReplaceAll(ret, "\n", "")
|
|
||||||
ret = strings.ReplaceAll(ret, "\t", " ")
|
|
||||||
reg := regexp.MustCompile("\\s{2,}")
|
reg := regexp.MustCompile("\\s{2,}")
|
||||||
ret = reg.ReplaceAllString(ret, " ")
|
ret = reg.ReplaceAllString(ret, " ")
|
||||||
msg := fmt.Sprintf("OCR [%s] [%s]", info.Name(), ret)
|
msg := fmt.Sprintf("OCR [%s] [%s]", info.Name(), ret)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue