aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
diff options
context:
space:
mode:
authorStanley Yip <stanley_yip@brown.edu>2020-02-10 20:02:43 -0500
committerStanley Yip <stanley_yip@brown.edu>2020-02-10 20:02:43 -0500
commitdc6453e27375a1b3d614a74b7fd1d83695f130d7 (patch)
treea459aebcd55d10e8d8013649bd1417aa3b5058f2 /src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
parentdaa8898f70bd44d2716f1f0d3371a8435a3ff638 (diff)
some final stuff
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 53fe2b18c..4b1bb09a9 100644
--- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
+++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
@@ -457,7 +457,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 => {
@@ -467,13 +466,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;
}
}