Skip to content

Commit

Permalink
🎨 Add logging siyuan-note#12960
Browse files Browse the repository at this point in the history
  • Loading branch information
88250 committed Oct 31, 2024
1 parent cb16e57 commit 59bb202
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kernel/util/ocr.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ func Tesseract(imgAbsPath string) (ret []map[string]interface{}) {
logging.LogInfof("tesseract [path=%s] success [%s]", imgAbsPath, tsv)

// 按行分割 TSV 数据
lines := strings.Split(tsv, "\r\n")
lines := strings.Split(tsv, "\n")

// 解析 TSV 数据 跳过标题行,从第二行开始处理
for _, line := range lines[1:] {
Expand Down Expand Up @@ -262,7 +262,7 @@ func GetOcrJsonText(jsonData []map[string]interface{}) (ret string) {
if text, ok := dataMap["text"]; ok {
// 确保 text 是字符串类型
if textStr, ok := text.(string); ok {
ret += " " + textStr
ret += " " + strings.ReplaceAll(textStr, "\r", "")
}
}
}
Expand Down

0 comments on commit 59bb202

Please sign in to comment.