iink SDK on Device

Unsupported Recognizer: Math

Hello, I'm brand new to MyScript so chances are high I'm doing something dumb. I'm developing in Swift on iOS. I have been able to get a text recognizer to work, but am not having luck with the other recognizer types.

I query and log the supported recognizer types and get:

 

supportedTypes=["Diagram", "Drawing", "Math", "Raw Content", "Text", "Text Document"]

 Yet if I request a non-text type, I get the following error (in this case I'm asking for a Text Document, but I really want Math):

 

Error, -[IINKEngine createRecognizerWithScaleX:scaleY:type:error:]::173 unsupported recognizer type: Text Document

 The code itself is quite simple:

 

    lazy var mathRecognizer: IINKRecognizer? = {
        if let engine = self.engine {
            let recognizer = try? engine.createRecognizer(scaleX: 1.0, scaleY: 1.0, type: "Text Document")
            recognizer?.add(self)
            return recognizer
        } else {
            return nil
        }
    }()

 Might anyone have any recommendations as to what I'm doing wrong here?


Thank you!


Hello


Thank you for your question.


The supported types that you are referring too correspond to SupportedPartTypes that are the types supported by the Editor objects, while the Recognizers types are given by the SupportedRecognizerTypes.

Currently the Recognizers types are "Text", "Gesture", "Shape", "Raw Content" and "Math". (see


The main difference between the Recognizer and the Editor is :

- The recognizers aim at performing real-time incremental recognition on transient ink. (see https://developer.myscript.com/docs/interactive-ink/3.1/overview/recognizers/ and https://developer.myscript.com/docs/interactive-ink/3.1/ios/advanced/recognizers/)

- The Editor support rendering-driven interactivity, meaning that you want to use iink SDK to perform the ink strokes rendering and use our interactive feature  (see https://developer.myscript.com/docs/interactive-ink/3.1/concepts/ink-capture/)


So, if you want to use a "Text Document", you should use an Editor object. (you can refer to our Demo example)

If you want to use a Recognizer, you should use another type.


Best regards,


Gwenaëlle


My apologies - I should have updated the posted code. I had been trying to instantiate a "Math" recognizer but was getting the cannot instantiate errors. I then tried the other types - the only type I can instantiate was Text. "Text Document" was just what I had checked last and I failed to update the posted code to be sure it was clear.

So, why would I be getting that error for a Math type?

Thank you!

Hello,


Thank you for your update.


There are two things to check to use your "Math" recognizer:

  1. For the moment, the Math Recognizer is not available on all platforms: check here whether your platform supports Math Recognizer
  2. In addition you must deploy the corresponding Math resources in your application. They are contained in the myscript-iink-recognition-math2.zip package, that you can download on https://developer.myscript.com/support/recognition-assets. you must also configure the value of the recognizer.configuration-manager.search-path key to the folder(s) containing your math Recognizer configuration file(s) (*.conf). For more details, please refer to https://developer.myscript.com/docs/interactive-ink/3.1/ios/advanced/recognizers/#math-recognizer


Best regards,


Gwenaëlle

Hmmm, I must still be doing something else wrong. I have both the Math and Math2 resources installed (have also tried them independently). Ive tried running across a range of simulators - iPhone through to iPad pro - get the same error. 

Nebo runs on my iPad and does math recognition (as does Goodnotes which I understand uses MyScript) so I'm assuming the basic hardware requirements are there.

Any other suggestions? Thank you!

Hello,


Based on the information you gave us, we were able to reproduce this issue. So thank you for your update and for identifying and sharing this with us.

We have identified the source of the problem, which is that the specific library required for the "Math" recognizer is missing from the podfile, So, the Text recognizer and Math Editor in the demo sample work fine, as they don't use this library.

We will let you know when the fix is available.


Best regards,


Gwenaëlle

Thank you!

Login or Signup to post a comment