Skip to content

Commit

Permalink
fix(basic.gblib): Get all text from webservice inside SEE TEXT keyword.
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigorodriguez committed Nov 25, 2021
1 parent 942c941 commit 8d61ae5
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions packages/basic.gblib/services/SystemKeywords.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,22 @@ export class SystemKeywords {

const result = (await computerVisionClient.recognizePrintedText(true, url));
const text = result.regions[0].lines[0].words[0].text;
// TODO: Create loop to get entire text.
GBLog.info(`GBVision (text): '${text}'`);
return text;
let final = '';

for (let i = 0; i < result.regions.length; i++) {
const region = result.regions[i];

for (let j = 0; j < region.lines.length; j++) {
const line = region.lines.words[j];

for (let k = 0; k < line.words.length; k++) {
final += line.words[k].text;
}
}
}

GBLog.info(`GBVision (text): '${final}'`);
return final;
}

public async sortBy(array, memberName) {
Expand Down

0 comments on commit 8d61ae5

Please sign in to comment.