/
githubmirror
/
tesseract.js
Обзор
Документация
Войти
/
githubmirror
/
tesseract.js
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
tests/detect.test.mjs
19 строк
625 B
Fanchen Kong
Enable WASM relaxed SIMD in tesseract.js (#1039)
15 дек 2025, 06:17
Не верифицирован
15 дек 2025, 06:17
1b0faec
Код
Авторство
О чём код?
import { IMAGE_PATH, TIMEOUT, OPTIONS } from './constants.mjs'; describe('detect()', () => { let worker; before(async function cb() { this.timeout(0); worker = await Tesseract.createWorker('osd', 0, OPTIONS); }); it('should detect OSD', async () => { const { data: { script: s } } = await worker.detect(`${IMAGE_PATH}/cosmic.png`); expect(s).to.be('Latin'); }).timeout(TIMEOUT); it('should detect OSD (simplified interface)', async () => { const { data: { script: s } } = await Tesseract.detect(`${IMAGE_PATH}/cosmic.png`, OPTIONS); expect(s).to.be('Latin'); }).timeout(TIMEOUT); });