diff options
| author | Mohammad Amoush <47069173+mamoush34@users.noreply.github.com> | 2020-02-08 17:03:12 -0500 |
|---|---|---|
| committer | Mohammad Amoush <47069173+mamoush34@users.noreply.github.com> | 2020-02-08 17:03:12 -0500 |
| commit | f9855e8d1ec83405ae3cc7d0113b46de63fc0848 (patch) | |
| tree | bf4be61a021e59b771c1cd5958fd9fd43cac8693 /src/client/cognitive_services/CognitiveServices.ts | |
| parent | 87f5f043388b591c52e96a795fa461a79770550d (diff) | |
| parent | 1b046f76cf39f1f6cb1875aa84b45db74b6d994e (diff) | |
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web into webcam_mohammad
Diffstat (limited to 'src/client/cognitive_services/CognitiveServices.ts')
| -rw-r--r-- | src/client/cognitive_services/CognitiveServices.ts | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/client/cognitive_services/CognitiveServices.ts b/src/client/cognitive_services/CognitiveServices.ts index 57296c961..9e2ceac62 100644 --- a/src/client/cognitive_services/CognitiveServices.ts +++ b/src/client/cognitive_services/CognitiveServices.ts @@ -185,8 +185,9 @@ export namespace CognitiveServices { results.recognitionUnits && (results = results.recognitionUnits); target[keys[0]] = Docs.Get.DocumentHierarchyFromJson(results, "Ink Analysis"); const recognizedText = results.map((item: any) => item.recognizedText); + const recognizedObjects = results.map((item: any) => item.recognizedObject); const individualWords = recognizedText.filter((text: string) => text && text.split(" ").length === 1); - target[keys[1]] = individualWords.join(" "); + target[keys[1]] = individualWords.length ? individualWords.join(" ") : recognizedObjects.join(", "); } batch.end(); |
