Interactive Ink

iOS Iink - Parsing leters and numbers on Math blocks

 Hey Guys.

I was wondering if there was any way to prioritize (or enforce) numbers recognition over letters when using Math bloks inside a Text Document part.

We usually experience '5's interpreted as 'S's and '7's as 'T's, for example, and usually, unless we write slow, there are misinterpretations which causes on calculations not being resolved.

Any tip to improve this?

Thanks!


Dear Just,


thank you for your question.


Currently, it is possible to have an ink sample (screenshot, ideally x and y cooredinates), so that we can reproduce?


Currently, there is now way to give more weight to digits over letters. The question is do you need the letters? In that case, you can create your custom math grammar removing the letters: https://developer.myscript.com/docs/interactive-ink/1.2/android/advanced/custom-recognition/#math-grammar


Best regards,


Olivier


1 person likes this

Hey Oliver!

Thanks for that approach, I think indeed would be helpful.

I'm trying to create a new grammar resource with the online tool (https://developer.myscript.com/support/recognition-assets/#resource-builder)

I managed to create one the first time, with a txt file with the code from the example you give here https://developer.myscript.com/docs/interactive-ink/1.2/android/advanced/build-custom-resources/#supported-symbols-and-rules , but after the first success, I couldn't create a new resource, nor with my modified code, nor with the same example I succeeded previously, I keep getting this screen:

image

Here are the txt I'm trying to upload:

https://cloud.gonxas.com/index.php/s/rbAMiabb7QgA6KK

https://cloud.gonxas.com/index.php/s/HWEWnpfgnYmFq7w


Could you give me a hand to understand what's happening?


Thanks!

Dear Just,


thank you for the update.


I am wondering why it could not compile. If this happens again, can you please give the ".def" extension to your source files?


Meanwhile, I compiled these on my side. Please find these attached.


Best regards,


Olivier

res
(1.04 KB)
res
(1.13 KB)

1 person likes this

Thanks Oliver, but I can't seem to be able to download the files.

Could you please share them by link?

Also, I just tried to compile them using the ".def" extension, but I get the same screen

image


Hey Oliver.

I just tried using Safari instead of Firefox and the resourse compiled, I guess it's an issue with the browser

I'm currently using Firefox Quantum 63.0.1 (64-bit)

One more question related to the building of custom resources, is it possible to change symbol's definitions? Particulary I would like to make x to multiply instead of *


Thanks!

Dear Just,


thank you for the updates.


Indeed, I am using the Firefox 59.0 64 bit version and it is working fine on my side.


Regarding your other question, a custom grammar definition doesn't allow to modify the multiply symbol. This shall be done as post-treatment, i.E. when getting the result, you check if it cointains the multiply symbol, and you update it when displaying the result.


Best regards,


Olivier

Gotcha, thanks!

One last thing, I keep getting crashes when trying to convert the Math block using this configuration:


 

symbol = 0 1 2 3 4 5 6 7 8 9 + - / ÷ = . , % | ( ) : * x √
leftpar = (
rightpar = )
currency_symbol = $ R € ₹ £
character ::= identity(symbol)
            | identity(currency_symbol)
fractionless ::= identity(character)
               | fence (fractionless, leftpar, rightpar)
               | hpair(fractionless, fractionless)
fractionable ::= identity(character)
               | fence (fractionable, leftpar, rightpar)
               | hpair(fractionable, fractionable)
               | fraction(fractionless, fractionless)
expression ::= identity(character)
             | fence (expression, leftpar, rightpar)
             | hpair(expression, expression)
             | fraction(fractionable, fractionable)
			 | sqrt(expression)
			 | superscript(symbol,expression)
			 | presuperscript(expression, symbol)
			 | vlist(expression)
start(expression)

 I noticed removing this line "| vlist(expression)" prevents the crashes, so I'm not using it right now, but I though I better let you know.


Thanks for your help!

Dear Just,


thank you for pointing this.


We are investigating, I keep you updated.


Best regards,


Olivier

Dear Just,


currently, of you need the vlist, the solution is the use it as below:


symbol = 0 1 2 3 4 5 6 7 8 9 + - / ÷ = . , % | ( ) : * x v
leftpar = (
rightpar = )
currency_symbol = $ R € ₹ £
character ::= identity(symbol)
          | identity(currency_symbol)
fractionless ::= identity(character)
             | fence (fractionless, leftpar, rightpar)
             | hpair(fractionless, fractionless)
fractionable ::= identity(character)
             | fence (fractionable, leftpar, rightpar)
             | hpair(fractionable, fractionable)
             | fraction(fractionless, fractionless)
expression ::= identity(character)
           | fence (expression, leftpar, rightpar)
           | hpair(expression, expression)
           | fraction(fractionable, fractionable)
           | sqrt(expression)
           | superscript(symbol,expression)
           | presuperscript(expression, symbol)

list ::= vlist(expression)

start(list)


Best regards,


Olivier

Login or Signup to post a comment