@xuda.io/drive_module 1.1.966 → 1.1.968
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +4 -3
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1724,7 +1724,7 @@ const ocr_drive_file = async function (app_id, doc) {
|
|
|
1724
1724
|
|
|
1725
1725
|
var ocr = "";
|
|
1726
1726
|
const generalConfig = { lang: "eng", oem: 1, psm: 3 };
|
|
1727
|
-
const franc = await import("franc");
|
|
1727
|
+
const { franc } = await import("franc");
|
|
1728
1728
|
|
|
1729
1729
|
switch (doc.mime.split("/")[0]) {
|
|
1730
1730
|
case "image": {
|
|
@@ -1734,7 +1734,8 @@ const ocr_drive_file = async function (app_id, doc) {
|
|
|
1734
1734
|
);
|
|
1735
1735
|
|
|
1736
1736
|
// Detect the language from the extracted text
|
|
1737
|
-
const detectedLang = franc
|
|
1737
|
+
const detectedLang = franc(initialText);
|
|
1738
|
+
debugger;
|
|
1738
1739
|
const tesseractLang = detectedLang || "eng";
|
|
1739
1740
|
ocr = await tesseract.recognize(target_file, tesseractLang);
|
|
1740
1741
|
|
|
@@ -1754,7 +1755,7 @@ const ocr_drive_file = async function (app_id, doc) {
|
|
|
1754
1755
|
);
|
|
1755
1756
|
|
|
1756
1757
|
// Detect the language from the extracted text
|
|
1757
|
-
const detectedLang = franc
|
|
1758
|
+
const detectedLang = franc(initialText);
|
|
1758
1759
|
const tesseractLang = detectedLang || "eng";
|
|
1759
1760
|
ocr += await tesseract.recognize(imageData.path, tesseractLang);
|
|
1760
1761
|
}
|