* Grab the description, and push it into redis. * @param {string} filename Name of the file being processed * @param {Index} index The Index object that wraps Redis * @param {*} response Individual response from the Cloud Vision API * @returns {Promise }
(filename, index, response)
| 164 | * @returns {Promise<void>} |
| 165 | */ |
| 166 | async function extractDescriptions(filename, index, response) { |
| 167 | if (response.textAnnotations.length) { |
| 168 | const words = extractDescription(response.textAnnotations); |
| 169 | await index.add(filename, words); |
| 170 | } else { |
| 171 | console.log(`${filename} had no discernable text.`); |
| 172 | await index.setContainsNoText(filename); |
| 173 | } |
| 174 | } |
| 175 | |
| 176 | /** |
| 177 | * Given a set of image file paths, extract the text and run them through the |
no test coverage detected