Skip to content

Commit

Permalink
Adding page attribute to Cell class (#17)
Browse files Browse the repository at this point in the history
* Adding page attribute to Cell class

* Bump version

---------

Co-authored-by: Emmanuel Hadoux <[email protected]>
  • Loading branch information
ailinvenerus and EHadoux authored Apr 21, 2023
1 parent 6f59244 commit 19486d7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@scribelabsai/amazon-trp",
"version": "2.0.5",
"version": "2.0.6",
"description": "Amazon Textract Response Parser library for Node.",
"type": "module",
"types": "./dist/index.d.ts",
Expand Down
1 change: 1 addition & 0 deletions src/BlockStruct.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ interface BlockBase extends Block {
Confidence: number;
Geometry: GeometryStruct;
Id: string;
Page: number;
Text?: string;
}

Expand Down
2 changes: 2 additions & 0 deletions src/Table/Cell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export class Cell {
content: (Word | SelectionElement)[];
text: string;
isHeader: boolean;
page: number;

constructor(block: CellBlock, blockMap?: BlockMap) {
this.block = block;
Expand All @@ -27,6 +28,7 @@ export class Cell {
this.geometry = new Geometry(block.Geometry);
this.id = block.Id;
this.content = [];
this.page = block.Page;
this.isHeader = block.EntityTypes?.includes('COLUMN_HEADER') ?? false;

const t: string[] = [];
Expand Down

0 comments on commit 19486d7

Please sign in to comment.