Answered

Answer

Dear Li Perry,

currently, in a Math part, you cannot use a subset knowledge, which can only be used for Text.

In a Math part, if you want to restrain the number of characters/symbols that can be recognized, the solution consists in creating you own grammar resource. The easier is that you use the existing grammar definitions, keep the symbols and patterns you want to recognize.

Then, you compile the grammar using the online tools and add it in your math.conf file:

-E.g., you can create mycustomGrammar.def

-You drop the .def file: https://developer.myscript.com/support/recognition-assets/#resource-builder

-You download the compiled resource, resp. mycustomGrammar.res

-You add it in the assets of your project (e.g. assets/resources/math/)

-You create a new configuration in the math.conf file:

Bundle-Version: 1.0 Bundle-Name: math Configuration-Script: AddResDir ../resources Name: standard Type: Math Configuration-Script: AddResource math/math-ak.res AddResource math/math-grm-standard.res

-You then set your configuration:Name: myConfType: Math Configuration-Script: AddResource math/math-ak.resAddResource math/mycustomGrammar.resconf.setString("math.configuration.name", "myConf");

When starting your applicatipn, you will now set you own grammar, with the symbols and patterns you want to recognize.

Let us know if you have any question.

Best regards,

Olivier

NB: please find the math-grm-standard.def as an attachment, which you can then tune according to your needs

## li perry

自己通过.sk文件中编写0123456789.然后生成.res文件；在.conf中配置好路径和Type:Math后;在代码中也引用了 conf.setString("math.configuration.bundle",

但在设置 math.configuration.name的时候只有自带的 AddResource math/math-grm-standard.res 代码中设置：standard 可用

而我之前自己通过.sk文件生成的.res文件却无效；请问我哪里出了问题呢？

Olivier @MyScriptsaid about 2 years agoDear Li Perry,

currently, in a Math part, you cannot use a subset knowledge, which can only be used for Text.

In a Math part, if you want to restrain the number of characters/symbols that can be recognized, the solution consists in creating you own grammar resource. The easier is that you use the existing grammar definitions, keep the symbols and patterns you want to recognize.

Then, you compile the grammar using the online tools and add it in your math.conf file:

-E.g., you can create mycustomGrammar.def

-You drop the .def file: https://developer.myscript.com/support/recognition-assets/#resource-builder

-You download the compiled resource, resp. mycustomGrammar.res

-You add it in the assets of your project (e.g. assets/resources/math/)

-You create a new configuration in the math.conf file:

When starting your applicatipn, you will now set you own grammar, with the symbols and patterns you want to recognize.

Let us know if you have any question.

Best regards,

Olivier

NB: please find the math-grm-standard.def as an attachment, which you can then tune according to your needs