UNPKG

mindee

Version:

Mindee Client Library for Node.js

17 lines (16 loc) 539 B
import { OcrWord } from "./ocrWord.js"; export class OcrPage { constructor(serverResponse) { this.words = serverResponse["words"].map(word => new OcrWord(word)); this.content = serverResponse["content"]; } toString() { let ocrWords = "\n"; if (this.words.length > 0) { ocrWords += this.words.map(word => word.toString()).join("\n\n"); } let outStr = `OCR Words\n---------${ocrWords}`; outStr += `\n\n:Content: ${this.content}`; return outStr; } }