Text

Answered

Recognizing custom lexicon - compound words

HI,

We are building a dictionary of words that we want myscript to recognize.

I am able to build a dictionary with single words. 

Is it possible to recognize compound words for e.g 

Crocin 100 Mg

Thanks,

Piyush




Best Answer

Dear Piyush,


no, it is not possible to give more weight to one resource or another.


Best regards,


Olivier


Dear Piyush,


thank you for contacting us.


Currently, you should use a grammar resource, that will allow you to "loop" in your lexicon. You can find more explanation in the following topic: https://developer-support.myscript.com/support/discussions/topics/16000023391


Best regards,


Olivier

Dear Olivier,

I went through the discussion but its still not clear what I need to do. 

I need to recognize around 20-30000 medical words and some of them are compound words.

Please can you tell me the steps that I can follow.

Also, I need to recognize general words.

Piyush


Dear Piyush,


thank you for the precision.


Currently, if you also want to recognize "general words", the easier is that you create a new configuration in your ".conf" file and add your custom lexicon with the TEXT resource.


Let's say you created the myResource.res resource and stored it into the "MyResources" directory of the assets. You should then create a configuration as follows:


Bundle-Version: 1.0
Bundle-Name: en_US
Configuration-Script:
 AddResDir ../resources/

Name: text
Type: Text
Configuration-Script:
 AddResource en_US/en_US-ak-cur.res
 AddResource en_US/en_US-lk-text.res
 EnableAlienCharacters
 SetTextListSize 1
 SetWordListSize 5
 SetCharListSize 1

Name: textwithMyResource
Type: Text
Configuration-Script:
 AddResource en_US/en_US-ak-cur.res
 AddResource en_US/en_US-lk-text.res
 AddResource MyResources/myResource.res
 EnableAlienCharacters
 SetTextListSize 1
 SetWordListSize 5
 SetCharListSize 1


You can then set the textwithMyResource configuration as follows: conf.setString("text.configuration.name","textwithMyResource");


You can also find this explanation in the following topics:

-https://developer-support.myscript.com/support/discussions/topics/16000024134

-https://github.com/MyScript/interactive-ink-examples-android/issues/5


Best regards,


Olivier



Thank you Olivier for the quick response. 

Will this work with compound words?

For e.g I want the system to recognize

Crocin 100 MG

Dear Piyush,


as the TEXT resource contains a GRM, you should normally be able to recognize compounds words.


Best regards,


Olivier

This is perfect. I got it to work. Is it possible to give preference to my lexicon over the words present in TEXT resource?

Answer

Dear Piyush,


no, it is not possible to give more weight to one resource or another.


Best regards,


Olivier