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

Function extractDescription

vision/textDetection.js:151–157  ·  view source on GitHub ↗

* Provide a joined string with all descriptions from the response data * @param {TextAnnotation[]} texts Response data from the Vision API * @returns {string} A joined string containing al descriptions

(texts)

Source from the content-addressed store, hash-verified

149 * @returns {string} A joined string containing al descriptions
150 */
151function extractDescription(texts) {
152 let document = '';
153 texts.forEach(text => {
154 document += text.description || '';
155 });
156 return document.toLowerCase();
157}
158
159/**
160 * Grab the description, and push it into redis.

Callers 1

extractDescriptionsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected