Browse Source

Use github page to host tessdata

pull/265/head
Jerome Wu 6 years ago
parent
commit
098c070e6d
  1. 28
      package-lock.json
  2. 2
      src/browser/index.js
  3. 2
      src/node/index.js

28
package-lock.json generated

@ -2162,12 +2162,14 @@ @@ -2162,12 +2162,14 @@
"balanced-match": {
"version": "1.0.0",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"brace-expansion": {
"version": "1.1.11",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
@ -2182,17 +2184,20 @@ @@ -2182,17 +2184,20 @@
"code-point-at": {
"version": "1.1.0",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"concat-map": {
"version": "0.0.1",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"console-control-strings": {
"version": "1.1.0",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"core-util-is": {
"version": "1.0.2",
@ -2309,7 +2314,8 @@ @@ -2309,7 +2314,8 @@
"inherits": {
"version": "2.0.3",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"ini": {
"version": "1.3.5",
@ -2321,6 +2327,7 @@ @@ -2321,6 +2327,7 @@
"version": "1.0.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"number-is-nan": "^1.0.0"
}
@ -2335,6 +2342,7 @@ @@ -2335,6 +2342,7 @@
"version": "3.0.4",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"brace-expansion": "^1.1.7"
}
@ -2342,12 +2350,14 @@ @@ -2342,12 +2350,14 @@
"minimist": {
"version": "0.0.8",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"minipass": {
"version": "2.2.4",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"safe-buffer": "^5.1.1",
"yallist": "^3.0.0"
@ -2366,6 +2376,7 @@ @@ -2366,6 +2376,7 @@
"version": "0.5.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"minimist": "0.0.8"
}
@ -2446,7 +2457,8 @@ @@ -2446,7 +2457,8 @@
"number-is-nan": {
"version": "1.0.1",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"object-assign": {
"version": "4.1.1",
@ -2458,6 +2470,7 @@ @@ -2458,6 +2470,7 @@
"version": "1.4.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"wrappy": "1"
}
@ -2579,6 +2592,7 @@ @@ -2579,6 +2592,7 @@
"version": "1.0.2",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0",

2
src/browser/index.js

@ -4,7 +4,7 @@ const { version } = require('../../package.json'); @@ -4,7 +4,7 @@ const { version } = require('../../package.json');
const defaultOptions = {
corePath: `https://cdn.jsdelivr.net/gh/naptha/tesseract.js-core@v2.0.0-beta.5/tesseract-core${typeof WebAssembly === 'object' ? '' : '.asm'}.js`,
langPath: 'https://cdn.jsdelivr.net/gh/naptha/tessdata@gh-pages/4.0.0',
langPath: 'https://tessdata.projectnaptha.com/4.0.0',
};
if (process.env.NODE_ENV === 'development') {

2
src/node/index.js

@ -17,7 +17,7 @@ const loadImage = (imageURI) => { @@ -17,7 +17,7 @@ const loadImage = (imageURI) => {
exports.defaultOptions = {
workerPath: path.join(__dirname, 'worker.js'),
langPath: 'https://cdn.jsdelivr.net/gh/naptha/tessdata@gh-pages/4.0.0/',
langPath: 'https://tessdata.projectnaptha.com/4.0.0/',
};
exports.spawnWorker = (instance, { workerPath }) => {

Loading…
Cancel
Save