You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
557 B
19 lines
557 B
const { createWorker } = Tesseract; |
|
const worker = createWorker(OPTIONS); |
|
before(function cb() { |
|
this.timeout(0); |
|
return worker.load(); |
|
}); |
|
|
|
describe('detect()', async () => { |
|
it('should detect OSD', () => { |
|
[ |
|
{ name: 'cosmic.png', ans: { script: 'Latin' } }, |
|
].forEach(async ({ name, ans: { script } }) => { |
|
await worker.loadLanguage('osd'); |
|
await worker.initialize('osd'); |
|
const { data: { script: s } } = await worker.detect(`${IMAGE_PATH}/${name}`); |
|
expect(s).to.be(script); |
|
}); |
|
}).timeout(TIMEOUT); |
|
});
|
|
|