mindee
Version:
Mindee Client Library for Node.js
28 lines (27 loc) • 1.06 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.UsMailV3 = void 0;
const common_1 = require("../../../parsing/common");
const usMailV3Document_1 = require("./usMailV3Document");
/**
* US Mail API version 3 inference prediction.
*/
class UsMailV3 extends common_1.Inference {
constructor(rawPrediction) {
super(rawPrediction);
/** The endpoint's name. */
this.endpointName = "us_mail";
/** The endpoint's version. */
this.endpointVersion = "3";
/** The document's pages. */
this.pages = [];
this.prediction = new usMailV3Document_1.UsMailV3Document(rawPrediction["prediction"]);
rawPrediction["pages"].forEach((page) => {
if (page.prediction !== undefined && page.prediction !== null &&
Object.keys(page.prediction).length > 0) {
this.pages.push(new common_1.Page(usMailV3Document_1.UsMailV3Document, page, page["id"], page["orientation"]));
}
});
}
}
exports.UsMailV3 = UsMailV3;