mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-29 04:48:48 +01:00
🎨 Tesseract OCR 语言包过滤 Fix https://github.com/siyuan-note/siyuan/issues/7242
This commit is contained in:
parent
a3bba94ad3
commit
d9b8d4fded
1 changed files with 12 additions and 3 deletions
|
|
@ -119,12 +119,21 @@ func initTesseract() {
|
|||
return
|
||||
}
|
||||
|
||||
for _, lang := range langs {
|
||||
TesseractLangs = append(TesseractLangs, lang)
|
||||
}
|
||||
TesseractLangs = filterTesseractLangs(langs)
|
||||
logging.LogInfof("tesseract-ocr enabled [ver=%s, langs=%s]", ver, strings.Join(TesseractLangs, "+"))
|
||||
}
|
||||
|
||||
func filterTesseractLangs(langs []string) (ret []string) {
|
||||
ret = []string{}
|
||||
for _, lang := range langs {
|
||||
if "eng" == lang || strings.HasPrefix(lang, "chi") || "fra" == lang || "spa" == lang || "deu" == lang ||
|
||||
"rus" == lang || "osd" == lang {
|
||||
ret = append(ret, lang)
|
||||
}
|
||||
}
|
||||
return ret
|
||||
}
|
||||
|
||||
func getTesseractVer() (ret string) {
|
||||
if ContainerStd != Container {
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue