@tess-data/eng
v0.1.3
Published
traineddata for tesseract.js
Downloads
10
Readme
@tess-data/eng
eng traineddata for tesseract.js
Most of the time, it is good enough for tesseract.js to download and cache traineddata files for you. But when you need use tesseract.js in a pure offline mode, you can use this package to solve the issue of fetching traineddata from remote.
Installation
$ npm install @tess-data/eng
Usage
Browser
<script src="https://unpkg.com/@tess-data/[email protected]/traineddata.js"></script>
<script src="https://unpkg.com/[email protected]/dist/tesseract.min.js"></script>
<script>
const { TesseractWorker } = Tesseract;
const worker = new TesseractWorker();
worker
.recognize('http://jeroen.github.io/images/testocr.png', [TESSDATA_ENG])
.then((result) => {
console.log(result);
});
</script>
Node.js
const TESSDATA_ENG = require('@tess-data/eng');
const { TesseractWorker } = require('tesseract.js');
const worker = new TesseractWorker();
worker
.recognize('http://jeroen.github.io/images/testocr.png', [TESSDATA_ENG])
.then((result) => {
console.log(result);
});