mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-24 18:50:56 +08:00
refactor(ocr): 将Tesseract服务文件移动到tesseract子目录并更新配置
This commit is contained in:
parent
3e454a262f
commit
9d8eea7f2e
@ -13,7 +13,7 @@ import {
|
||||
import { statSync } from 'fs'
|
||||
import { readFile } from 'fs/promises'
|
||||
|
||||
import { getTesseractWorker } from './TesseractService'
|
||||
import { getTesseractWorker } from './tesseract/TesseractService'
|
||||
|
||||
const logger = loggerService.withContext('main:OcrService')
|
||||
|
||||
|
||||
@ -110,7 +110,10 @@ let worker: Tesseract.Worker | null = null
|
||||
export const getTesseractWorker = async (): Promise<Tesseract.Worker> => {
|
||||
if (!worker) {
|
||||
// for now, only support limited languages
|
||||
worker = await createWorker(['chi_sim', 'chi_tra', 'eng'])
|
||||
worker = await createWorker(['chi_sim', 'chi_tra', 'eng'], undefined, {
|
||||
dataPath: '',
|
||||
gzip: false
|
||||
})
|
||||
}
|
||||
return worker
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user