aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
diff options
context:
space:
mode:
authorkimdahey <claire_kim1@brown.edu>2020-02-10 22:49:01 -0500
committerkimdahey <claire_kim1@brown.edu>2020-02-10 22:49:01 -0500
commit9e9b775160e5d3b375c8c6e46c90f53291de6ee5 (patch)
tree29e743121f522983c746a1acc46552153e4dad50 /src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
parent4b09b59dc31b089eada895fa0eabac95fd3931bd (diff)
parentdc6453e27375a1b3d614a74b7fd1d83695f130d7 (diff)
Merge branch 'pen' of https://github.com/browngraphicslab/Dash-Web into pull_pane
Diffstat (limited to 'src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx')
-rw-r--r--src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
index 85349b6e3..1f2cdaea4 100644
--- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
+++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
@@ -460,7 +460,6 @@ export class CollectionFreeFormView extends CollectionSubView(PanZoomDocument) {
const inkFields = inks.map(i => Cast(i.data, InkField));
CognitiveServices.Inking.Appliers.InterpretStrokes(inkFields.filter(i => i instanceof InkField).map(i => i!.inkData)).then((results) => {
const wordResults = results.filter((r: any) => r.category === "inkWord");
- console.log(wordResults);
for (const word of wordResults) {
const indices: number[] = word.strokeIds;
indices.forEach(i => {
@@ -470,13 +469,13 @@ export class CollectionFreeFormView extends CollectionSubView(PanZoomDocument) {
const uniqueColors: string[] = [];
Array.from(this._wordPalette.values()).forEach(c => uniqueColors.indexOf(c) === -1 && uniqueColors.push(c));
inks[i].alternativeColors = new List<string>(uniqueColors);
- if (this._wordPalette.has(word.recognizedText)) {
- inks[i].color = this._wordPalette.get(word.recognizedText);
+ if (this._wordPalette.has(word.recognizedText.toLowerCase())) {
+ inks[i].color = this._wordPalette.get(word.recognizedText.toLowerCase());
}
else {
for (const alt of word.alternates) {
- if (this._wordPalette.has(alt.recognizedString)) {
- inks[i].color = this._wordPalette.get(alt.recognizedString);
+ if (this._wordPalette.has(alt.recognizedString.toLowerCase())) {
+ inks[i].color = this._wordPalette.get(alt.recognizedString.toLowerCase());
break;
}
}