samples/textDetection.js
async function lookup(words) {
  const index = new Index();
  const hits = await index.lookup(words);
  index.quit();
  words.forEach((word, i) => {
    console.log(`hits for "${word}":`, hits[i].join(', '));
  });
  return hits;
}
async function lookup(words) {
  const index = new Index();
  const hits = await index.lookup(words);
  index.quit();
  words.forEach((word, i) => {
    console.log(`hits for "${word}":`, hits[i].join(', '));
  });
  return hits;
}
async function lookup ( words ) { const index = new Index ( ) ; const hits = await index . lookup ( words ) ; index . quit ( ) ; words . forEach ( ( word , i ) => { console . log ( ` ${ word } ` , hits [ i ] . join ( ', ' ) ) ; } ) ; return hits ; }
Given a list of words, lookup any matches in the database.
@param {string[]} words
@returns {Promise<string[][]>}
Given a list of words lookup any matches in the database .