@anytestforpm/ocr 1.2.3 → 1.3.1
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/README.md +1 -1
- package/ocr.js +7 -1
- package/package.json +1 -1
package/README.md
CHANGED
package/ocr.js
CHANGED
|
@@ -12,7 +12,10 @@ const OCR_LANGUAGE_MAP = {
|
|
|
12
12
|
BR: "por",
|
|
13
13
|
EN: "eng",
|
|
14
14
|
MM: "mya+eng",
|
|
15
|
-
|
|
15
|
+
PK: "eng",
|
|
16
|
+
TH: "tha+eng",
|
|
17
|
+
PH: "eng",
|
|
18
|
+
NG: "eng"
|
|
16
19
|
}
|
|
17
20
|
|
|
18
21
|
const setResponseData = (val) => {
|
|
@@ -130,6 +133,9 @@ export const recognizeOCR = async (ImageUrl) => {
|
|
|
130
133
|
//OCR辨識結果的內文
|
|
131
134
|
const result = await worker.recognize(ImageUrl);
|
|
132
135
|
const resText = String(result.data.text);
|
|
136
|
+
if (configData.region === "TH") {
|
|
137
|
+
resText = resText.replace(" ","");
|
|
138
|
+
}
|
|
133
139
|
console.log("OCR Text >>> ", resText);
|
|
134
140
|
|
|
135
141
|
//比對不合法的關鍵字
|