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

Function lookup

vision/textDetection.js:136–144  ·  view source on GitHub ↗

* Given a list of words, lookup any matches in the database. * @param {string[]} words * @returns {Promise }

(words)

Source from the content-addressed store, hash-verified

134 * @returns {Promise<string[][]>}
135 */
136async function lookup(words) {
137 const index = new Index();
138 const hits = await index.lookup(words);
139 index.quit();
140 words.forEach((word, i) => {
141 console.log(`hits for "${word}":`, hits[i].join(', '));
142 });
143 return hits;
144}
145
146/**
147 * Provide a joined string with all descriptions from the response data

Callers 1

textDetection.jsFile · 0.70

Calls 2

lookupMethod · 0.95
quitMethod · 0.95

Tested by

no test coverage detected