Skip to content

Commit 56d8238

Browse files
authored
Updated output and types per #990 (#992)
1 parent 901d881 commit 56d8238

File tree

3 files changed

+1
-105
lines changed

3 files changed

+1
-105
lines changed

src/createWorker.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
const resolvePaths = require('./utils/resolvePaths');
2-
const circularize = require('./utils/circularize');
32
const createJob = require('./createJob');
43
const { log } = require('./utils/log');
54
const getId = require('./utils/getId');
@@ -204,11 +203,7 @@ module.exports = async (langs = 'eng', oem = OEM.LSTM_ONLY, _options = {}, confi
204203
const promiseId = `${action}-${jobId}`;
205204
if (status === 'resolve') {
206205
log(`[${workerId}]: Complete ${jobId}`);
207-
let d = data;
208-
if (action === 'recognize') {
209-
d = circularize(data);
210-
}
211-
promises[promiseId].resolve({ jobId, data: d });
206+
promises[promiseId].resolve({ jobId, data });
212207
delete promises[promiseId];
213208
} else if (status === 'reject') {
214209
promises[promiseId].reject(data);

src/index.d.ts

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -152,14 +152,9 @@ declare namespace Tesseract {
152152
paragraphs: Paragraph[];
153153
text: string;
154154
confidence: number;
155-
baseline: Baseline;
156155
bbox: Bbox;
157156
blocktype: string;
158-
polygon: any;
159157
page: Page;
160-
lines: Line[];
161-
words: Word[];
162-
symbols: Symbol[];
163158
}
164159
interface Baseline {
165160
x0: number;
@@ -186,38 +181,21 @@ declare namespace Tesseract {
186181
baseline: Baseline;
187182
rowAttributes: RowAttributes
188183
bbox: Bbox;
189-
paragraph: Paragraph;
190-
block: Block;
191-
page: Page;
192-
symbols: Symbol[];
193184
}
194185
interface Paragraph {
195186
lines: Line[];
196187
text: string;
197188
confidence: number;
198-
baseline: Baseline;
199189
bbox: Bbox;
200190
is_ltr: boolean;
201-
block: Block;
202-
page: Page;
203-
words: Word[];
204-
symbols: Symbol[];
205191
}
206192
interface Symbol {
207-
choices: Choice[];
208-
image: any;
209193
text: string;
210194
confidence: number;
211-
baseline: Baseline;
212195
bbox: Bbox;
213196
is_superscript: boolean;
214197
is_subscript: boolean;
215198
is_dropcap: boolean;
216-
word: Word;
217-
line: Line;
218-
paragraph: Paragraph;
219-
block: Block;
220-
page: Page;
221199
}
222200
interface Choice {
223201
text: string;
@@ -228,38 +206,17 @@ declare namespace Tesseract {
228206
choices: Choice[];
229207
text: string;
230208
confidence: number;
231-
baseline: Baseline;
232209
bbox: Bbox;
233-
is_numeric: boolean;
234-
in_dictionary: boolean;
235-
direction: string;
236-
language: string;
237-
is_bold: boolean;
238-
is_italic: boolean;
239-
is_underlined: boolean;
240-
is_monospace: boolean;
241-
is_serif: boolean;
242-
is_smallcaps: boolean;
243-
font_size: number;
244-
font_id: number;
245210
font_name: string;
246-
line: Line;
247-
paragraph: Paragraph;
248-
block: Block;
249-
page: Page;
250211
}
251212
interface Page {
252213
blocks: Block[] | null;
253214
confidence: number;
254-
lines: Line[];
255215
oem: string;
256216
osd: string;
257-
paragraphs: Paragraph[];
258217
psm: string;
259-
symbols: Symbol[];
260218
text: string;
261219
version: string;
262-
words: Word[];
263220
hocr: string | null;
264221
tsv: string | null;
265222
box: string | null;

src/utils/circularize.js

Lines changed: 0 additions & 56 deletions
This file was deleted.

0 commit comments

Comments
 (0)