Interactive Ink

Answered

unable to convert pointerEvents to text in android or accurately at MyScriptJS

I have been trying to convert x-y coordinates obtained from the wacom clipboard my handwritten text-

image

i have converted it to PointerEvents as-

image

follows as how i obtained pointer events array from clipboard strokes

pointerEvents2[k] = new PointerEvent(PointerEventType.CANCEL, saved_strokes.get(i)[j].x, saved_strokes.get(i)[j].y, saved_strokes.get(i)[j].timestampInMillis, 1.0f, PointerType.PEN, 1);

editor.pointerEvents(pointerEvents2,false);
editor.waitForIdle();
try {
editor.export_(null, MimeType.TEXT);
} catch (IOException e) {
e.printStackTrace();
}

*Editor have been initialised and all but i still get error at editor.pointerEvents(pointerEvents2,false);

Please help me out where it got wrong.

I also tried same text points conversion on MyScriptJs but it isn't accurate with words its doing fine with the characters-

image

at-

https://myscript.github.io/MyScriptJS/examples/v4/pointer_events.html

txt

Best Answer

Dear Jai,


after reviewing your code, the issue occurs because yur array has an empty element.


When declaring the pointerEvent2 arrays, you have one element over: PointerEvent[] pointerEvents2 = new PointerEvent[size + 1];

Instead, you should declare it as follows: PointerEvent[] pointerEvents2 = new PointerEvent[size + 1];


Regarding your second question, you do not have the possibility to force to multi-line mode. This is managed internally.


Best regards,


Olivier



1 person has this question

Dear Pankaj,


did you follow the instructions in the "Advanced -> Custom recognition" part of the documentation: https://developer.myscript.com/docs/interactive-ink/1.2/web/advanced/custom-recognition/


Also, did you give a try to the REST API: https://developer.myscript.com/docs/interactive-ink/1.2/web/rest/architecture/


The latter may better match your expectations.


Best regards,


Olivier

Dear Olivier,

Thanks for your Reply.

I think the link you provided me in last post is for web platform.

I am using this for android app with wacom babmoo smart pad.

I have done with adding own resource file by your support.

Now i have one question :

After exporting JIIX format label(" actual word") and candidates appear .I completed with this and show label and candidates on view(my app custom view).

but now i want know that if i don't find my written and expected word in the candidate list then how to change that word .

Is there  only way that is to add own resource or any other way is also there.

Thanks & Regards

Pankaj Tyagi 


Dear Pankaj,


thank you for your question.


If I understand well, after export to JIIX, you would like to modify the "label" of the JIIX with a candidate that is not among the candidates of the JIIX and import this JIIX? This is not possible, you can only update the label with one of the candidates.


Nevertheless, if writing a word that is not among our standard lexicons, adding a custom lexicon is likely to help recognize it (e.g. medical terms, or abbreviations). This can be done as indicated in our documentation.


Please note that the 1.3 release of the iink that is to be released shortly (within few days) will have the possibility to compile lexicons on the device.


I think the link you provided me in last post is for web platform.

>>We were not sure you were using the native our Cloud version of the iink.


Best regards,


Olivier

Dear Olivier,

Good morning

Thanks for your answer.

Yes, you exactly got my point what i was trying to saying.

Nevertheless, if writing a word that is not among our standard lexicons, adding a custom lexicon is likely to help recognize it (e.g. medical terms, or abbreviations). This can be done as indicated in our documentation.

>> Yes, I already done it.

Please note that the 1.3 release of the iink that is to be released shortly (within few days) will have the possibility to compile lexicons on the device.

>> That's a good news. Best wishes for your next release. Eagerly waiting for next release.

We were not sure you were using the native our Cloud version of the iink.

>>No ,I am not using this.

Thanks for your support.

Regards,

Pankaj Tyagi

Dear Olivier,

Thanks for all your prompt support it does solved all my issues.


Thanks with regards,

Jai Singh Hada

Dear Pankaj,


Thank you for contacting us.


As stated above in this thread, can you confirm you set the text.guides.enable to false? This is usually the cause of inaccurate recognition.


In web, it can be done as follows: https://developer.myscript.com/docs/interactive-ink/1.2/web/reference/configuration-myscriptjs/#text

Android/iOS: https://developer.myscript.com/docs/interactive-ink/1.2/reference/configuration/#text


Best regards,


Olivier