mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-07-03 14:09:06 +02:00
🎨 Tesseract OCR 语言包过滤 Fix https://github.com/siyuan-note/siyuan/issues/7242
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user