I attempted to adjust the `websocket_math_custom_resources_compiled.html` example from iinkTS to point to a custom resource definition.
For that purpose, I downloaded the sample math grammar file from the documentation and fed it into the online conversion tool where I selected version 2.3 which AFAICT is the appropriate version for that example.
I uploaded the generated resource and uploaded it to the cloud console and adjusted the iinkTS sample to point at its name.
It does not work; nothing is recognised. I see no errors in the console.
If I upload the pre-made maths grammar resource for that version as a "custom" grammar, it works fine.
What I'm actually attempting to achieve it to add a certain notation to the "normal" maths grammar in a device that uses iink 2.0 (I'm only using the web demo for quick and easy feedback cycles). AFAICT I must replace the whole grammar to achieve this; if it's possible to modify a resource file (or turn it into a definition file) instead, that would be extremely helpful.
Best Answer
G
Gwenaelle @MyScript
said
29 days ago
Dear user,
Thank you for contacting us.
I could not reproduce your issue, using this procedure:
As I told you a couple of weeks ago, this notation is not yet supported by our math recognition engine: so if you add the dot to the symbol5, you will be able to generate a correct grammar from a syntactic point of view, but you won't get the ẋ in the recognition output, as our engine has not been trained to recognize and output such a notation.
I have forwarded your request for Newton notation to our product line and we will add it to our backlog, but at the moment we can't say whether nor when this notation will be supported.
If you would like to share more information and details about your project, please feel free to contact our sales team
Best regards,
Gwenaëlle
M
Myscript. jalapeno367
said
10 days ago
Hi, another update:
I tried using the grammar on a device and it is unfortunately not practical to use. In most cases the . is simply ignored, gets turned into a middle dot in the exponent or is interpreted as a dot or comma on the previous line.
The dot is also very very small compared to the characters themselves. I tried using characters that have a larger footprint such as the ● symbol and ⋅ ・ ⸳ ⸱ ⚫ • . to fix that and perhaps also aid recognition but they were not recognised.
I also tried using ○ ◦ but, while one of them was being recognised sometimes, most often it'd be recognised as 0 in the exponent or as a 0 on the previous line.
Are there any ways to make the recognition more accurate? I wrote the symbols directly above the character but it'd still recognise it as an exponent.
I also tried using the U+0307 COMBINING DOT ABOVE and U+0308 COMBINING DIAERESIS characters to combine them with the regular symbol set to create e.g. q̇ ẍ but it would not recognise those characters. Does myscript support such diacritics?
Thanks,
G
Gwenaelle @MyScript
said
22 days ago
Hello,
Thank you for your update.
Indeed your grammar content actual update can only be determined by checking whether the grammar changes are in effect writing some math ink and checking the recognition output.
This is also what I did and could see the grammar was the expected one.
> I could not reproduce your problem: if I generate a new grammar with the same .res file name and upload it with the same resource name in my console, I can see the change. > > Maybe you did not reload the websocket_math_custom_resources_compiled.html page when you ran your test? Please note that the grammar is loaded when the websocket is opened and session configured, so if you change the grammar and test with an already existing websocket iink session, this may explain why you don't see the changes.
I force-reloaded the local webpage every time I made a change.
If I reproduce again, I'll pay more attention to the steps it takes to do so.
Note that uploading apparently worked for me but the grammar in effect was actually still the previous; this can only be determined by checking whether the grammar changes are in effect.
> Thank you for sharing so much detail and information about the Newton notation you are willing to recognize. > This notation is not yet supported by our math recognition engine: so if you add the dot to the symbol5, you will be able to generate a correct grammar from a syntactic point of view, but you won't get the ẋ in the recognition output.
In my testing, it does the right thing already. It recognises it as e.g. `x^{.}` in case of LaTeX output which is what I expected. (The character in my previous reply was a approximation using a unicode control character; I don't actually want that to be the output.)
It was a bit fiddly to get it to recognise the dot as such though. That might have been because I was using a laptop touchpad for testing, so I'll have to see how it behaves on an actual device. (I only used the web thing for easy prototyping.)
> I will forward your request for Newton notation to our product line and we will add it to our backlog, but at the moment we can't say if or when this notation will be supported.
Thanks!
G
Gwenaelle @MyScript
said
25 days ago
Hello,
Thank you for your update.
I could not reproduce your problem: if I generate a new grammar with the same .res file name and upload it with the same resource name in my console, I can see the change.
Maybe you did not reload the websocket_math_custom_resources_compiled.html page when you ran your test? Please note that the grammar is loaded when the websocket is opened and session configured, so if you change the grammar and test with an already existing websocket iink session, this may explain why you don't see the changes.
Thank you for sharing so much detail and information about the Newton notation you are willing to recognize. This notation is not yet supported by our math recognition engine: so if you add the dot to the symbol5, you will be able to generate a correct grammar from a syntactic point of view, but you won't get the ẋ in the recognition output.
I will forward your request for Newton notation to our product line and we will add it to our backlog, but at the moment we can't say if or when this notation will be supported.
Best regards,
Gwenaëlle
M
Myscript. jalapeno367
said
28 days ago
Hello Gwenaëlle,
thank you very much for attempting to reproduce my issue!
I've attempted to reproduce just now using the same names as you did and was also not able to reproduce.
I then attempted to modify the grammar definition and doing the same steps again (overwriting files at each step) but those changes did not come into effect. Could you attempt to reproduce?
Uploading the modified grammar definition file under a different name works fine, so something must be holding a reference to an old state here.
This could very well have been my original issue because it'd cause the same symptom if I ever attempted to create a grammar before, which I did.
(I forgot to mention that I modified the server-configuration.json accordingly of course.)
> I am not sure to understand what you mean by "add a certain notation".
Indeed the grammar must only contain elements and rules that are listed
in this page https://developer.myscript.com/docs/interactive-ink/3.2/overview/math-elements-and-rules/ > You cannot add a notation that is not listed in this page, as our engine won't be able to recognise it. > > Could you please share more details about the notation you would like to add?
I should have explained more; I meant a notation that can be mapped to the provided structure primitives.
It's quite simple: Allow an overscript with one or multiple dots above terms such as x or q. This is Newton's notation for differentiation where ẋ (notice the overdot) is equivalent to e.g. dx/dt. This notation is used quite a lot in physics where many important terms are often just time derivatives of other terms (e.g. velocity is the time derivative of position) and it's often important to make that explicit.
Theoretically there could be any number of dots but one or two dots is by far the most common. You could have dots over dots or a combination of both which is equivalent (only the number of dots counts) but this is also a lot less common. More than 3 dots on one level would be pushing it.
Your maths grammar DSL appears to be quite flexible, so it certainly ought to be possible to implement this notation even in its full form, though just . and .. and perhaps ... would be sufficient IMHO.
I'll attempt to get a PoC working with the (now working) example grammar. Should be as simple as adding symbols to symbol5 in the example grammar AFAICT.
In the real world, I'd of course prefer if this grammar was based on the "normal" maths grammar with all of its supported notations and whatnot which you publish as a pre-made .res file.
Would it be possible to publish the associated def "source" file of that grammar? That would be very helpful for people like me who have some specific notation or symbol they need to add but otherwise want the entire rest of the mathematical notation work too that you have already made.
Otherwise, my only options would be to attempt to re-implement your maths grammar and probably missing a bunch of stuff or attempt to reverse-engineer your .res format to patch the "compiled" form.
Thanks again a bunch for the quick reply!
G
Gwenaelle @MyScript
said
29 days ago
Answer
Dear user,
Thank you for contacting us.
I could not reproduce your issue, using this procedure:
Myscript. jalapeno367
I attempted to adjust the `websocket_math_custom_resources_compiled.html` example from iinkTS to point to a custom resource definition.
For that purpose, I downloaded the sample math grammar file from the documentation and fed it into the online conversion tool where I selected version 2.3 which AFAICT is the appropriate version for that example.
I uploaded the generated resource and uploaded it to the cloud console and adjusted the iinkTS sample to point at its name.
It does not work; nothing is recognised. I see no errors in the console.
If I upload the pre-made maths grammar resource for that version as a "custom" grammar, it works fine.
What I'm actually attempting to achieve it to add a certain notation to the "normal" maths grammar in a device that uses iink 2.0 (I'm only using the web demo for quick and easy feedback cycles). AFAICT I must replace the whole grammar to achieve this; if it's possible to modify a resource file (or turn it into a definition file) instead, that would be extremely helpful.
Dear user,
Thank you for contacting us.
I could not reproduce your issue, using this procedure:
I wrote a simple-grammar.def grammar that contains the example snippet of the documentation page
Then I've built it with the online tool, selecting "Grammar" output that has generated the corresponding resource:
Then I have modified the websocket_math_custom_resources_compiled.html example to use this custom grammar :
The resources works as expected.
Please make sure to replace in your examples/server-configuration.json the hmac and application keys by yours, too.
I am not sure to understand what you mean by "add a certain notation". Indeed the grammar must only contain elements and rules that are listed in this page https://developer.myscript.com/docs/interactive-ink/3.2/overview/math-elements-and-rules/
You cannot add a notation that is not listed in this page, as our engine won't be able to recognise it.
Could you please share more details about the notation you would like to add?
Best regards,
Gwenaëlle
- Oldest First
- Popular
- Newest First
Sorted by Newest FirstGwenaelle @MyScript
Hello,
Thank you for your update.
As I told you a couple of weeks ago, this notation is not yet supported by our math recognition engine: so if you add the dot to the symbol5, you will be able to generate a correct grammar from a syntactic point of view, but you won't get the ẋ in the recognition output, as our engine has not been trained to recognize and output such a notation.
I have forwarded your request for Newton notation to our product line and we will add it to our backlog, but at the moment we can't say whether nor when this notation will be supported.
If you would like to share more information and details about your project, please feel free to contact our sales team
Best regards,
Gwenaëlle
Myscript. jalapeno367
I tried using the grammar on a device and it is unfortunately not practical to use. In most cases the . is simply ignored, gets turned into a middle dot in the exponent or is interpreted as a dot or comma on the previous line.
The dot is also very very small compared to the characters themselves. I tried using characters that have a larger footprint such as the ● symbol and ⋅ ・ ⸳ ⸱ ⚫ • . to fix that and perhaps also aid recognition but they were not recognised.
I also tried using ○ ◦ but, while one of them was being recognised sometimes, most often it'd be recognised as 0 in the exponent or as a 0 on the previous line.
Are there any ways to make the recognition more accurate? I wrote the symbols directly above the character but it'd still recognise it as an exponent.
I also tried using the U+0307 COMBINING DOT ABOVE and U+0308 COMBINING DIAERESIS characters to combine them with the regular symbol set to create e.g. q̇ ẍ but it would not recognise those characters. Does myscript support such diacritics?
Gwenaelle @MyScript
Hello,
Thank you for your update.
Indeed your grammar content actual update can only be determined by checking whether the grammar changes are in effect writing some math ink and checking the recognition output.
This is also what I did and could see the grammar was the expected one.
Thank you for your precision about the expected LaTeX output. My understanding was that you wanted to get '\dot x' as a LaTeX output, as described in this discussion https://math.meta.stackexchange.com/questions/20451/newton-derivative-notation-in-latex not x^{.} which in LaTex is not rendered as described on Newton's notation
Best regards,
Gwenaëlle
Myscript. jalapeno367
> I could not reproduce your problem: if I generate a new grammar with the same .res file name and upload it with the same resource name in my console, I can see the change.
>
> Maybe you did not reload the websocket_math_custom_resources_compiled.html page when you ran your test? Please note that the grammar is loaded when the websocket is opened and session configured, so if you change the grammar and test with an already existing websocket iink session, this may explain why you don't see the changes.
I force-reloaded the local webpage every time I made a change.
If I reproduce again, I'll pay more attention to the steps it takes to do so.
Note that uploading apparently worked for me but the grammar in effect was actually still the previous; this can only be determined by checking whether the grammar changes are in effect.
> Thank you for sharing so much detail and information about the Newton notation you are willing to recognize.
> This notation is not yet supported by our math recognition engine: so if you add the dot to the symbol5, you will be able to generate a correct grammar from a syntactic point of view, but you won't get the ẋ in the recognition output.
In my testing, it does the right thing already. It recognises it as e.g. `x^{.}` in case of LaTeX output which is what I expected. (The character in my previous reply was a approximation using a unicode control character; I don't actually want that to be the output.)
It was a bit fiddly to get it to recognise the dot as such though. That might have been because I was using a laptop touchpad for testing, so I'll have to see how it behaves on an actual device. (I only used the web thing for easy prototyping.)
> I will forward your request for Newton notation to our product line and we will add it to our backlog, but at the moment we can't say if or when this notation will be supported.
Thanks!
Gwenaelle @MyScript
Hello,
Thank you for your update.
I could not reproduce your problem: if I generate a new grammar with the same .res file name and upload it with the same resource name in my console, I can see the change.
Maybe you did not reload the websocket_math_custom_resources_compiled.html page when you ran your test? Please note that the grammar is loaded when the websocket is opened and session configured, so if you change the grammar and test with an already existing websocket iink session, this may explain why you don't see the changes.
Thank you for sharing so much detail and information about the Newton notation you are willing to recognize.
This notation is not yet supported by our math recognition engine: so if you add the dot to the symbol5, you will be able to generate a correct grammar from a syntactic point of view, but you won't get the ẋ in the recognition output.
I will forward your request for Newton notation to our product line and we will add it to our backlog, but at the moment we can't say if or when this notation will be supported.
Best regards,
Gwenaëlle
Myscript. jalapeno367
> You cannot add a notation that is not listed in this page, as our engine won't be able to recognise it.
>
> Could you please share more details about the notation you would like to add?
Gwenaelle @MyScript
Dear user,
Thank you for contacting us.
I could not reproduce your issue, using this procedure:
I wrote a simple-grammar.def grammar that contains the example snippet of the documentation page
Then I've built it with the online tool, selecting "Grammar" output that has generated the corresponding resource:
Then I have modified the websocket_math_custom_resources_compiled.html example to use this custom grammar :
The resources works as expected.
Please make sure to replace in your examples/server-configuration.json the hmac and application keys by yours, too.
I am not sure to understand what you mean by "add a certain notation". Indeed the grammar must only contain elements and rules that are listed in this page https://developer.myscript.com/docs/interactive-ink/3.2/overview/math-elements-and-rules/
You cannot add a notation that is not listed in this page, as our engine won't be able to recognise it.
Could you please share more details about the notation you would like to add?
Best regards,
Gwenaëlle