@anytestforpm/ocr 1.3.7 → 1.3.8
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/ocr.js +7 -1
- package/package.json +1 -1
package/ocr.js
CHANGED
|
@@ -147,7 +147,13 @@ export const recognizeOCR = async (ImageUrl) => {
|
|
|
147
147
|
}
|
|
148
148
|
|
|
149
149
|
//比對合法的關鍵字
|
|
150
|
-
let validKeyWords = configData.keywords.valid.filter((item) =>
|
|
150
|
+
let validKeyWords = configData.keywords.valid.filter((item) => {
|
|
151
|
+
if (configData.region === "TH") {
|
|
152
|
+
return resText.search(item.replace(/\s+/g,"")) >= 0
|
|
153
|
+
} else {
|
|
154
|
+
return resText.search(item) >= 0
|
|
155
|
+
}
|
|
156
|
+
});
|
|
151
157
|
console.log("search valid keywords result >>> ", validKeyWords);
|
|
152
158
|
if (validKeyWords.length >= configData.config.verify_in_counts) {
|
|
153
159
|
resolve(setResponseData(RESULT_TYPE.KEYWORDS_SUCCESS));
|