2

I am using the MyScript Interactive ink SDK to convert handwritten math equations. I tested out the SDK using the test examples they have and everything worked great. I imported a lot of their code logic to my application and am successfully able to set up the engine and the editor. I can write items and even use the redo, clear and undo items in the editor. The problem is that every time I attempt to covert it, it returns a "?".

The function to convert is below and is exactly the same as the code in the example that MyScript provides -

@IBAction func ConvertButtonWasTouchedUpInside(_ sender: UIBarButtonItem) {
    do {
        editorViewController.editor.waitForIdle()
        let supportedTargetStates = editorViewController.editor.getSupportedTargetConversionState(nil)
        try editorViewController.editor.convert(nil, targetState: supportedTargetStates[0].value)
    } catch {
        print("Error while converting : " + error.localizedDescription)
    }
    do
    {
        try equationInLatex = editorViewController.editor.export_(nil, mimeType: .laTeX)

    }
    catch
    {
        print("Error while printing : " + error.localizedDescription)
    }
    print(equationInLatex)
}

The code to create the package for the engine and the code to setup in engine in the file AppDelegate.swift is also the same.

I have attached an image on what the return value looks

like here

enter image description here

I am not able to figure out why I am experiencing this error and what part of the engine and/or editor set-up I am doing incorrectly.

Thank You!

coder
  • 8,346
  • 16
  • 39
  • 53
R T
  • 21
  • 1

1 Answers1

2

It looks like you're missing the recognition assets.

In the provided GetStartedSwift example there is a recognition-assets folder that is referenced in the "Copy Bundle Resources" build phase, as shown in the snapshot. You must copy those files to your project as well.

recognition assets

You can rename the recognition-assets folder if you wish, but if you do so you'll have to change the "configuration-manager.search-path" setting in AppDelegate.swift

If you only want math recognition you may want to copy only math related files: conf/math.conf, resources/math/math-ak.res, and resources/math/math-grm-atk.res

jng
  • 307
  • 4
  • 4