Math replace comma to dot when exporting in "application/vnd.myscript.jiix" format
V
Vadim Nikolski
started a topic
over 2 years ago
Hey! I am using myscript web math in my app, so when i try to write for example "1,2" i get "1.2" when exporting in application/vnd.myscript.jiix format, but for application/x-latex format it is exports with comma. I need to be it comma for application/vnd.myscript.jiix format.
Best Answer
O
Olivier @MyScript
said
over 2 years ago
Dear Vadim,
currently, as said above, the Math recognition cannot recognize such pattern.
I then allowed myself to create a custom ludef, which shall be used with the text recognition.
Hey! I would like to recognize just several numbers divided by comma
O
Olivier @MyScript
said
over 2 years ago
Dear Vadim,
currently, the Math content type is not adapted for such use-case.
What kind of text expression would you like to recognize?
Thank you,
Best regards,
Olivier
V
Vadim Nikolski
said
over 2 years ago
Yeah! Exactly. For example it can be pair into parentheses like "(1, 2)" but it comes with dot
G
Gwenaelle @MyScript
said
over 2 years ago
Thank you for your update.
If you are using a "Math" content type, MyScript iink expects the content to be a mathematical expression, ie a set of elements and rules according to the configured grammar.
When you indicate two numbers divided by comma, I understand that you mean two digits separated by a comma as a text separator, not a comma as a mathematical symbol.
Is my understanding correct?
Best regards,
Gwenaëlle
V
Vadim Nikolski
said
over 2 years ago
But when i write expression with dot i need it to be a dot
So imagine case where i need to write two numbers not as decimal numbers but just like two numbers divided by comma. In this case without 'decimal-separator': ',' i get one decimal number like "1.2", but if i set this 'decimal-separator': ',' then i will always get comma as separator
G
Gwenaelle @MyScript
said
over 2 years ago
Hi Vadim,
Thank you for your question.
You should tune your "math.solver.decimal-separator" to use comma.
So assuming that you are using iinkJS , the configuration would look like:
Vadim Nikolski
Hey! I am using myscript web math in my app, so when i try to write for example "1,2" i get "1.2" when exporting in application/vnd.myscript.jiix format, but for application/x-latex format it is exports with comma. I need to be it comma for application/vnd.myscript.jiix format.
Dear Vadim,
currently, as said above, the Math recognition cannot recognize such pattern.
I then allowed myself to create a custom ludef, which shall be used with the text recognition.
Please find the compiled resource attached.
In order to use it, you shall first ensure you upload the resource on your dashboard: https://developer.myscript.com/docs/interactive-ink/latest/android/advanced/custom-recognition/
If you name it for example "MYCUST", you shall then call it accordingly in the text configuration ; I also recommend you disable the "addLKText".
You can then refer to the "websocket_text_custom_resources" to adapt the code accordingly (https://github.com/MyScript/iinkJS/blob/master/examples/v4/websocket_text_custom_resources.html)
You can then set the configuration as follows:
iink: {
text: {
configuration: {
addLKText: false,
customResources: ['MYCUST']
}
}
}
For information, the source of the resource:
digit=[0-9]
comma=[,]
dot=[.]
number={digit}*({dot}{digit}*)?
expr={number}({comma}{number})?
{expr}
Let us know if you have any question.
Best regards,
Olivier
- Oldest First
- Popular
- Newest First
Sorted by Newest FirstOlivier @MyScript
Dear Vadim,
currently, as said above, the Math recognition cannot recognize such pattern.
I then allowed myself to create a custom ludef, which shall be used with the text recognition.
Please find the compiled resource attached.
In order to use it, you shall first ensure you upload the resource on your dashboard: https://developer.myscript.com/docs/interactive-ink/latest/android/advanced/custom-recognition/
If you name it for example "MYCUST", you shall then call it accordingly in the text configuration ; I also recommend you disable the "addLKText".
You can then refer to the "websocket_text_custom_resources" to adapt the code accordingly (https://github.com/MyScript/iinkJS/blob/master/examples/v4/websocket_text_custom_resources.html)
You can then set the configuration as follows:
iink: {
text: {
configuration: {
addLKText: false,
customResources: ['MYCUST']
}
}
}
For information, the source of the resource:
digit=[0-9]
comma=[,]
dot=[.]
number={digit}*({dot}{digit}*)?
expr={number}({comma}{number})?
{expr}
Let us know if you have any question.
Best regards,
Olivier
Vadim Nikolski
Hey! I would like to recognize just several numbers divided by comma
Olivier @MyScript
Dear Vadim,
currently, the Math content type is not adapted for such use-case.
What kind of text expression would you like to recognize?
Thank you,
Best regards,
Olivier
Vadim Nikolski
Yeah! Exactly. For example it can be pair into parentheses like "(1, 2)" but it comes with dot
Gwenaelle @MyScript
Thank you for your update.
If you are using a "Math" content type, MyScript iink expects the content to be a mathematical expression, ie a set of elements and rules according to the configured grammar.
When you indicate two numbers divided by comma, I understand that you mean two digits separated by a comma as a text separator, not a comma as a mathematical symbol.
Is my understanding correct?
Best regards,
Gwenaëlle
Vadim Nikolski
But when i write expression with dot i need it to be a dot
So imagine case where i need to write two numbers not as decimal numbers but just like two numbers divided by comma. In this case without 'decimal-separator': ',' i get one decimal number like "1.2", but if i set this 'decimal-separator': ',' then i will always get comma as separator
Gwenaelle @MyScript
Hi Vadim,
Thank you for your question.
You should tune your "
math.solver.decimal-separator
" to use comma.So assuming that you are using iinkJS , the configuration would look like:
With this configuration, the label in the JIIX export has the comma as a separator, as in the attached snapshot.
Best regards,
Gwenaëlle