Closed 01wa closed 2 years ago
How is this related to Tesseract documentation?
let worker =await Tesseract.createWorker({
workerPath: '/tesseract/node_modules/tesseract.js/dist/worker.min.js',
langPath: '/tesseract/lang-data',
corePath: '/tesseract/node_modules/tesseract.js-core/tesseract-core.wasm.js',
logger: progressUpdate
});
await worker.load();
await worker.loadLanguage('eng+chi_sim');
await worker.initialize('chi_sim');
await worker.setParameters({
tessedit_ocr_engine_mode: tessedit_ocr_engine_mode
});
在loadLanguage过程中,会失败,
We do not provide support for 3rd party projects. Please replicate problem with tesseract executable.
修复方法work.js function(t, e, r) { var n, i; void 0 === (i = "function" == typeof(n = function() { return function() { var t = arguments.length; if (0 === t) throw new Error("resolveUrl requires at least one argument; got none."); var e = document.createElement("base"); if (e.href = arguments[0], 1 === t) return e.href; var r = document.getElementsByTagName("head")[0]; r.insertBefore(e, r.firstChild); for (var n, i = document.createElement("a"), o = 1; o < t; o++) i.href = arguments[o], n = i.href, e.href = n; return r.removeChild(e), n } }) ? n.call(e, r, e, t) : n) || (t.exports = i) } 修改为 function(t, e, r) { var n, i; void 0 === (i = "function" == typeof(n = function() { return function() { var t = arguments.length; if (0 === t) throw new Error("resolveUrl requires at least one argument; got none."); return arguments[0]; } }) ? n.call(e, r, e, t) : n) || (t.exports = i) } 即可,原因时url在ipv6地址解析的问题,使用域名访问ipv6没有为你