Browse Source

add errorHandler documentation

pull/368/head
Charles Francoise 5 years ago
parent
commit
67ccfcfb6e
  1. 3
      docs/api.md

3
docs/api.md

@ -42,6 +42,7 @@ createWorker is a factory function that creates a tesseract worker, a worker is @@ -42,6 +42,7 @@ createWorker is a factory function that creates a tesseract worker, a worker is
- `workerBlobURL` a boolean to define whether to use Blob URL for worker script, default: true
- `gzip` a boolean to define whether the traineddata from the remote is gzipped, default: true
- `logger` a function to log the progress, a quick example is `m => console.log(m)`
- `errorHandler` a function to handle worker errors, a quick example is `err => console.error(err)`
**Examples:**
@ -144,7 +145,7 @@ Worker.setParameters() set parameters for Tesseract API (using SetVariable()), i @@ -144,7 +145,7 @@ Worker.setParameters() set parameters for Tesseract API (using SetVariable()), i
**Supported Paramters:**
| name | type | default value | description |
| ---- | ---- | ------------- | ----------- |
| --------------------------- | ------ | ----------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| tessedit\_ocr\_engine\_mode | enum | OEM.DEFAULT | Check [HERE](https://github.com/tesseract-ocr/tesseract/blob/4.0.0/src/ccstruct/publictypes.h#L268) for definition of each mode |
| tessedit\_pageseg\_mode | enum | PSM.SINGLE\_BLOCK | Check [HERE](https://github.com/tesseract-ocr/tesseract/blob/4.0.0/src/ccstruct/publictypes.h#L163) for definition of each mode |
| tessedit\_char\_whitelist | string | '' | setting white list characters makes the result only contains these characters, useful the content in image is limited |

Loading…
Cancel
Save