ocr-document-classification
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -40,3 +40,3 @@ "use strict"; | ||
var Tesseract = __toESM(require("tesseract.js")); | ||
var import_pdfjs_dist = require("pdfjs-dist"); | ||
var pdfjsLib = __toESM(require("pdfjs-dist")); | ||
function findTargetWords(documentText, targetWords, threshold = 0.75) { | ||
@@ -69,4 +69,3 @@ const foundTargetWords = []; | ||
async function extractTextFromPDF(fileContent) { | ||
import_pdfjs_dist.GlobalWorkerOptions.workerSrc = `//cdnjs.cloudflare.com/ajax/libs/pdf.js/${import_pdfjs_dist.version}/pdf.worker.js`; | ||
const pdf = await (0, import_pdfjs_dist.getDocument)({ data: fileContent }).promise; | ||
const pdf = await pdfjsLib.getDocument({ data: fileContent }).promise; | ||
let text = ""; | ||
@@ -73,0 +72,0 @@ for (let i = 0; i < pdf.numPages; i++) { |
{ | ||
"name": "ocr-document-classification", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Document classification using tesseract.js and string-similarity-js.", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14915
287