iink SDK on Device

Answered

Candidates for multiple words?

I'm hoping I'm being dense here and am missing something :)

I've found that the Text recognizer submits candidates for the first word in a sequence but not following ones. For example, if I write "Hello" I get a bounding box surrounding Hello and then a collection of candidates for Hello.

If I then add World (same line or different line) then the bounding box is expanded to both and the label field of the recognizer results contains "Hello World" but candidates are still kept at options for Hello.

What I would really love to have is an array of words, with candidates and bounding boxes for each. (I would also like to be doing shape recognition mixed in here, which is driving part of my question).

Is there a way I'm missing that I can do this, or should I be clearing and rebuilding the recognizer state for each word as it's written (which seems to have lots of issues and edge conditions).

Thank you!


Best Answer

Hello Shannonholl,


Thank you for contacting us.
I am not sure that I have understood you issue.
Indeed, when using a TextRecognizer in incremental mode with a IRecognizerListener, here is the result that I have logged when writing "Hello how are":


resultChanged 1

{
"type": "Text",
"bounding-box": {
"x": -82.1624985,
"y": -28.2138882,
"width": 66.5,
"height": 18.8402786
},
"label": "hello",
"words": [ {
"label": "hello",
"candidates": [ "hello", "heler", "helar", "heleo", "helor" ],
"bounding-box": {
"x": -82.1624985,
"y": -28.2138882,
"width": 66.5,
"height": 18.8402786
}
} ],
"version": "3",
"id": "MainBlock"
}


resultChanged 2

{
"type": "Text",
"bounding-box": {
"x": -82.1624985,
"y": -32.4800911,
"width": 93.375,
"height": 23.1064796
},
"label": "hello how",
"words": [ {
"label": "hello",
"candidates": [ "hello", "heleo", "heler", "heloo", "hellr" ],
"bounding-box": {
"x": -82.1624985,
"y": -28.2138882,
"width": 66.5,
"height": 18.8402786
}
}, {
"label": " "
}, {
"label": "how",
"candidates": [ "how", "hew", "hou", "hon", "How" ],
"bounding-box": {
"x": -11.6156235,
"y": -32.4800911,
"width": 22.828125,
"height": 20.8611107
}
} ],
"version": "3",
"id": "MainBlock"
}



resultChanged 3

{
"type": "Text",
"bounding-box": {
"x": -82.1624985,
"y": -32.4800911,
"width": 140.854156,
"height": 24.4537029
},
"label": "hello how are",
"words": [ {
"label": "hello",
"candidates": [ "hello", "heleo", "helo", "hells", "beleo" ],
"bounding-box": {
"x": -82.1624985,
"y": -28.2138882,
"width": 66.5,
"height": 18.8402786
}
}, {
"label": " "
}, {
"label": "how",
"candidates": [ "how", "hew", "hon", "Low", "tow" ],
"bounding-box": {
"x": -11.6156235,
"y": -32.4800911,
"width": 22.828125,
"height": 20.8611107
}
}, {
"label": " "
}, {
"label": "are",
"candidates": [ "are", "aree", "Are", "ane" ],
"bounding-box": {
"x": 15.0354176,
"y": -21.0287018,
"width": 43.65625,
"height": 13.0023136
}
} ],
"version": "3",
"id": "MainBlock"
}


As you can see, all word have their associated candidates.

So, please, could you help me understand your issue? Sharing your JIIX export may help me understand.


Best regards,


Gwenaëlle


Answer

Hello Shannonholl,


Thank you for contacting us.
I am not sure that I have understood you issue.
Indeed, when using a TextRecognizer in incremental mode with a IRecognizerListener, here is the result that I have logged when writing "Hello how are":


resultChanged 1

{
"type": "Text",
"bounding-box": {
"x": -82.1624985,
"y": -28.2138882,
"width": 66.5,
"height": 18.8402786
},
"label": "hello",
"words": [ {
"label": "hello",
"candidates": [ "hello", "heler", "helar", "heleo", "helor" ],
"bounding-box": {
"x": -82.1624985,
"y": -28.2138882,
"width": 66.5,
"height": 18.8402786
}
} ],
"version": "3",
"id": "MainBlock"
}


resultChanged 2

{
"type": "Text",
"bounding-box": {
"x": -82.1624985,
"y": -32.4800911,
"width": 93.375,
"height": 23.1064796
},
"label": "hello how",
"words": [ {
"label": "hello",
"candidates": [ "hello", "heleo", "heler", "heloo", "hellr" ],
"bounding-box": {
"x": -82.1624985,
"y": -28.2138882,
"width": 66.5,
"height": 18.8402786
}
}, {
"label": " "
}, {
"label": "how",
"candidates": [ "how", "hew", "hou", "hon", "How" ],
"bounding-box": {
"x": -11.6156235,
"y": -32.4800911,
"width": 22.828125,
"height": 20.8611107
}
} ],
"version": "3",
"id": "MainBlock"
}



resultChanged 3

{
"type": "Text",
"bounding-box": {
"x": -82.1624985,
"y": -32.4800911,
"width": 140.854156,
"height": 24.4537029
},
"label": "hello how are",
"words": [ {
"label": "hello",
"candidates": [ "hello", "heleo", "helo", "hells", "beleo" ],
"bounding-box": {
"x": -82.1624985,
"y": -28.2138882,
"width": 66.5,
"height": 18.8402786
}
}, {
"label": " "
}, {
"label": "how",
"candidates": [ "how", "hew", "hon", "Low", "tow" ],
"bounding-box": {
"x": -11.6156235,
"y": -32.4800911,
"width": 22.828125,
"height": 20.8611107
}
}, {
"label": " "
}, {
"label": "are",
"candidates": [ "are", "aree", "Are", "ane" ],
"bounding-box": {
"x": 15.0354176,
"y": -21.0287018,
"width": 43.65625,
"height": 13.0023136
}
} ],
"version": "3",
"id": "MainBlock"
}


As you can see, all word have their associated candidates.

So, please, could you help me understand your issue? Sharing your JIIX export may help me understand.


Best regards,


Gwenaëlle

Hmmm, the issue is I'm an idiot! I was dealing with some log truncation issues coupled with another issue that was making it less obvious! Works great - thank you!

Login or Signup to post a comment