MCPcopy Create free account
hub / github.com/GoogleCloudPlatform/nodejs-docs-samples / printLines

Function printLines

document-ai/process-document-ocr.js:120–129  ·  view source on GitHub ↗
(lines, text)

Source from the content-addressed store, hash-verified

118 };
119
120 const printLines = (lines, text) => {
121 console.log(` ${lines.length} lines detected:`);
122 const firstLineText = getText(lines[0].layout.textAnchor, text);
123 console.log(` First line text: ${JSON.stringify(firstLineText)}`);
124 const lastLineText = getText(
125 lines[lines.length - 1].layout.textAnchor,
126 text
127 );
128 console.log(` Last line text: ${JSON.stringify(lastLineText)}`);
129 };
130
131 const printTokens = (tokens, text) => {
132 console.log(` ${tokens.length} tokens detected:`);

Callers 1

processDocumentFunction · 0.85

Calls 1

getTextFunction · 0.70

Tested by

no test coverage detected