diff --git a/docs/api.md b/docs/api.md index 0ca6c03aa..887c4dad8 100644 --- a/docs/api.md +++ b/docs/api.md @@ -31,7 +31,7 @@ **Arguments:** -- `langs` a string to indicate the languages traineddata to download, multiple languages are concated with **+**, ex: **eng+chi\_tra** +- `langs` a string to indicate the languages traineddata to download, multiple languages are specified using an array (['eng', 'chi_sim']) - `oem` a enum to indicate the OCR Engine Mode you use - `options` an object of customized options - `corePath` path to a directory containing **both** `tesseract-core.wasm.js` and `tesseract-core-simd.wasm.js` from [Tesseract.js-core](https://www.npmjs.com/package/tesseract.js-core) package @@ -155,7 +155,7 @@ This list is incomplete. As Tesseract.js passes parameters to the Tesseract eng **Arguments:** -- `langs` a string to indicate the languages traineddata to download, multiple languages are concated with **+**, ex: **eng+chi\_tra** +- `langs` a string to indicate the languages traineddata to download, multiple languages are specified using an array (['eng', 'chi_sim']) - `oem` a enum to indicate the OCR Engine Mode you use - `config` an object of customized options which are set prior to initialization (see details above) - `jobId` Please see details above diff --git a/docs/examples.md b/docs/examples.md index 97a37701b..7207aab42 100644 --- a/docs/examples.md +++ b/docs/examples.md @@ -37,7 +37,7 @@ const worker = await createWorker('eng', 1, { ```javascript const { createWorker } = require('tesseract.js'); -const worker = await createWorker('eng+chi_tra'); +const worker = await createWorker(['eng', 'chi_tra']); (async () => { const { data: { text } } = await worker.recognize('https://tesseract.projectnaptha.com/img/eng_bw.png'); diff --git a/tests/recognize.test.js b/tests/recognize.test.js index 573783665..5f118fde6 100644 --- a/tests/recognize.test.js +++ b/tests/recognize.test.js @@ -145,7 +145,7 @@ describe('recognize()', () => { .map(name => ({ name, mode: PSM[name] })) .forEach(({ name, mode }) => ( it(`support PSM.${name} mode`, async () => { - await workerLegacy.reinitialize('eng+osd'); + await workerLegacy.reinitialize(['eng', 'osd']); await workerLegacy.setParameters({ tessedit_pageseg_mode: mode, }); @@ -162,7 +162,7 @@ describe('recognize()', () => { .map(name => ({ name, mode: PSM[name] })) .forEach(({ name, mode }) => ( it(`support PSM.${name} mode`, async () => { - await worker.reinitialize('eng+osd'); + await worker.reinitialize(['eng', 'osd']); await worker.setParameters({ tessedit_pageseg_mode: mode, });