@briancullen/aws-textract-parser
Version:
Library for converting AWS Textract responses into a more usable structure.
36 lines (35 loc) • 1.56 kB
JavaScript
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var BlockNode_1 = __importDefault(require("./BlockNode"));
var types_1 = require("../types");
var LineBlockNode = /** @class */ (function (_super) {
__extends(LineBlockNode, _super);
function LineBlockNode(id, geometry, text, confidence, words) {
var _this = _super.call(this, words.sort(function (a, b) { return a.geometry.boundaryBox.left - b.geometry.boundaryBox.left; })) || this;
_this.id = id;
_this.geometry = geometry;
_this.text = text;
_this.confidence = confidence;
_this.blockType = types_1.BlockType.Line;
words.forEach(function (word) { return word.setParant(_this); });
return _this;
}
return LineBlockNode;
}(BlockNode_1.default));
exports.default = LineBlockNode;
;