@luii/node-tesseract-ocr 1.0.0 → 1.0.9
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
CHANGED
|
@@ -6,13 +6,47 @@ Status: **WIP**
|
|
|
6
6
|
|
|
7
7
|
Lizenz: **AGPL-3.0**
|
|
8
8
|
|
|
9
|
-
---
|
|
10
|
-
|
|
11
9
|
## Public API
|
|
12
10
|
|
|
13
11
|
### Class: `Tesseract`
|
|
14
12
|
|
|
15
|
-
####
|
|
13
|
+
#### TesseractOptions
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
{
|
|
17
|
+
/**
|
|
18
|
+
* Its generally safer to use as few languages as possible.
|
|
19
|
+
* The more languages Tesseract needs to load the longer
|
|
20
|
+
* it takes to recognize a image.
|
|
21
|
+
* @public
|
|
22
|
+
*/
|
|
23
|
+
lang: Array<keyof typeof AvailableLanguages>;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Skip Ocr for when you only want to (for example) analyze the layout
|
|
27
|
+
* @property {boolean} [skipOcr]
|
|
28
|
+
*/
|
|
29
|
+
skipOcr?: boolean;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* OCR Engine Modes
|
|
33
|
+
* The engine mode cannot be changed after creating the instance
|
|
34
|
+
* If another mode is needed, its advised to create a new instance.
|
|
35
|
+
* @throws {Error} Will throw an error when oem mode is below 0 or over 3
|
|
36
|
+
*/
|
|
37
|
+
oemMode?: OcrEngineMode;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Page Segmentation Modes
|
|
41
|
+
* The page segmentation mode cannot be changed after creating the instance
|
|
42
|
+
* If another mode is needed, its advised to create a new instance.
|
|
43
|
+
* @throws {Error} Will throw a error when psm mode is below 0 or over 13
|
|
44
|
+
*/
|
|
45
|
+
psm?: PageSegmentationMode;
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
#### constructor(options: TesseractOptions)
|
|
16
50
|
|
|
17
51
|
```ts
|
|
18
52
|
new Tesseract({
|
|
@@ -49,9 +83,7 @@ recognize(buffer: Buffer, RecognizeOptions) => Promise<{
|
|
|
49
83
|
}
|
|
50
84
|
```
|
|
51
85
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
## Vorraussetzungen
|
|
86
|
+
## Prerequisities
|
|
55
87
|
|
|
56
88
|
- nodejs
|
|
57
89
|
- python3 (for `node-gyp`)
|
|
@@ -63,8 +95,6 @@ recognize(buffer: Buffer, RecognizeOptions) => Promise<{
|
|
|
63
95
|
|
|
64
96
|
> See [Install](#install)
|
|
65
97
|
|
|
66
|
-
---
|
|
67
|
-
|
|
68
98
|
## Install
|
|
69
99
|
|
|
70
100
|
```bash
|
|
@@ -96,9 +126,9 @@ NODE_TESSERACT_DATAPATH=/usr/share/tesseract-ocr/5/tessdata npm run dev
|
|
|
96
126
|
## Examples
|
|
97
127
|
|
|
98
128
|
```bash
|
|
99
|
-
NODE_TESSERACT_DATAPATH=/usr/share/tesseract-ocr/5/
|
|
129
|
+
NODE_TESSERACT_DATAPATH=/usr/share/tesseract-ocr/5/tessdata npm run examples:recognize
|
|
100
130
|
```
|
|
101
131
|
|
|
102
132
|
## Special Thanks
|
|
103
133
|
|
|
104
|
-
- Stunt3000
|
|
134
|
+
- **Stunt3000**
|
package/package.json
CHANGED
|
@@ -1,11 +1,37 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@luii/node-tesseract-ocr",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.9",
|
|
4
4
|
"private": false,
|
|
5
5
|
"gypfile": true,
|
|
6
6
|
"main": "dist/cjs/index.cjs",
|
|
7
7
|
"module": "dist/esm/index.mjs",
|
|
8
8
|
"types": "dist/index.d.ts",
|
|
9
|
+
"homepage": "https://github.com/luii/node-tesseract-ocr",
|
|
10
|
+
"repository": {
|
|
11
|
+
"url": "https://github.com/luii/node-tesseract-ocr",
|
|
12
|
+
"type": "git"
|
|
13
|
+
},
|
|
14
|
+
"bugs": {
|
|
15
|
+
"url": "https://github.com/luii/node-tesseract-ocr/issues"
|
|
16
|
+
},
|
|
17
|
+
"maintainers": [
|
|
18
|
+
{
|
|
19
|
+
"name": "luii",
|
|
20
|
+
"url": "https://github.com/luii/"
|
|
21
|
+
}
|
|
22
|
+
],
|
|
23
|
+
"license": "AGPL-3.0",
|
|
24
|
+
"author": {
|
|
25
|
+
"url": "https://github.com/luii/",
|
|
26
|
+
"name": "luii"
|
|
27
|
+
},
|
|
28
|
+
"keywords": [
|
|
29
|
+
"ocr",
|
|
30
|
+
"tesseract",
|
|
31
|
+
"leptonica",
|
|
32
|
+
"node-gyp",
|
|
33
|
+
"node-addon-api"
|
|
34
|
+
],
|
|
9
35
|
"publishConfig": {
|
|
10
36
|
"access": "public"
|
|
11
37
|
},
|
|
Binary file
|
|
Binary file
|