Browse Source

Release 2.0.0-alpha.10

pull/288/head v2.0.0-alpha.10
Jerome Wu 6 years ago
parent
commit
a1512f61a4
  1. 2
      README.md
  2. 6
      docs/faq.md
  3. 8
      docs/local-installation.md
  4. 2
      package-lock.json
  5. 2
      package.json

2
README.md

@ -39,7 +39,7 @@ Tesseract.js works with a `<script>` tag via local copy or CDN, with webpack via @@ -39,7 +39,7 @@ Tesseract.js works with a `<script>` tag via local copy or CDN, with webpack via
You can simply include Tesseract.js with a CDN like this:
```html
<script src='https://unpkg.com/tesseract.js@v2.0.0-alpha.8/dist/tesseract.min.js'></script>
<script src='https://unpkg.com/tesseract.js@v2.0.0-alpha.10/dist/tesseract.min.js'></script>
```
After including your scripts, the `Tesseract` variable will be defined globally!

6
docs/faq.md

@ -24,7 +24,11 @@ const { TesseractWorker } = Tesseract; @@ -24,7 +24,11 @@ const { TesseractWorker } = Tesseract;
const worker = new TesseractWorker();
worker
.recognize('https://tesseract.projectnaptha.com/img/eng_bw.png')
.recognize('https://tesseract.projectnaptha.com/img/eng_bw.png', 'eng', {
tessedit_create_box: '1',
tessedit_create_unlv: '1',
tessedit_create_osd: '1',
})
.then((result) => {
console.log(result.text);
console.log(result.hocr);

8
docs/local-installation.md

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
## Local Installation
Check here for an example: https://github.com/jeromewu/tesseract.js-offline
Check here for examples: https://github.com/naptha/tesseract.js/blob/master/docs/examples.md
In browser environment, `tesseract.js` simply provides the API layer. Internally, it opens a WebWorker to handle requests. That worker itself loads code from the Emscripten-built `tesseract.js-core` which itself is hosted on a CDN. Then it dynamically loads language files hosted on another CDN.
@ -10,7 +10,7 @@ In Node.js environment, the only path you may want to customize is languages/lan @@ -10,7 +10,7 @@ In Node.js environment, the only path you may want to customize is languages/lan
```javascript
const worker = Tesseract.TesseractWorker({
workerPath: 'https://unpkg.com/tesseract.js@v2.0.0-alpha.8/dist/worker.min.js',
workerPath: 'https://unpkg.com/tesseract.js@v2.0.0-alpha.10/dist/worker.min.js',
langPath: 'https://tessdata.projectnaptha.com/4.0.0',
corePath: 'https://unpkg.com/tesseract.js-core@v2.0.0-beta.10/tesseract-core.wasm.js',
});
@ -23,6 +23,6 @@ A string specifying the location of the [worker.js](./dist/worker.min.js) file. @@ -23,6 +23,6 @@ A string specifying the location of the [worker.js](./dist/worker.min.js) file.
A string specifying the location of the tesseract language files, with default value 'https://tessdata.projectnaptha.com/4.0.0'. Language file URLs are calculated according to the formula `langPath + langCode + '.traineddata.gz'`.
### corePath
A string specifying the location of the [tesseract.js-core library](https://github.com/naptha/tesseract.js-core), with default value 'https://unpkg.com/tesseract.js-core@v2.0.0-beta.8/tesseract-core.wasm.js' (fallback to tesseract-core.asm.js when WebAssembly is not available).
A string specifying the location of the [tesseract.js-core library](https://github.com/naptha/tesseract.js-core), with default value 'https://unpkg.com/tesseract.js-core@v2.0.0-beta.10/tesseract-core.wasm.js' (fallback to tesseract-core.asm.js when WebAssembly is not available).
Another WASM option is 'https://unpkg.com/tesseract.js-core@v2.0.0-beta.8/tesseract-core.js' which is a script that loads 'https://unpkg.com/tesseract.js-core@v2.0.0-beta.8/tesseract-core.wasm'. But it fails to fetch at this moment.
Another WASM option is 'https://unpkg.com/tesseract.js-core@v2.0.0-beta.10/tesseract-core.js' which is a script that loads 'https://unpkg.com/tesseract.js-core@v2.0.0-beta.10/tesseract-core.wasm'. But it fails to fetch at this moment.

2
package-lock.json generated

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
{
"name": "tesseract.js",
"version": "2.0.0-alpha.9",
"version": "2.0.0-alpha.10",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

2
package.json

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
{
"name": "tesseract.js",
"version": "2.0.0-alpha.9",
"version": "2.0.0-alpha.10",
"description": "Pure Javascript Multilingual OCR",
"main": "src/index.js",
"scripts": {

Loading…
Cancel
Save