@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.
Files changed (3) hide show
  1. package/README.md +1 -1
  2. package/ocr.js +7 -1
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Install
2
2
  npm i @anytestforpm/ocr
3
3
  # Language Support
4
- 支持地區為: VN IN ID BR MM TH EN
4
+ 支持地區為: VN IN ID BR MM PK TH PH NG
5
5
  # Usage Example
6
6
  1.初始化OCR的辨識語系及API路由設定,就會自動取得后台設定檔
7
7
  ```javascript
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
- TH: "tha+eng"
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
  //比對不合法的關鍵字
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anytestforpm/ocr",
3
- "version": "1.2.3",
3
+ "version": "1.3.1",
4
4
  "description": "",
5
5
  "main": "ocr.js",
6
6
  "scripts": {