Software Development Kit

Answered

Custom Lexicon not working for me

 

I am trying to develop an android app that requires the use of medicine dictionary. I have used https://developer.myscript.com/support/recognition-assets to generate the resource with "Interactive Ink SDK"  and "Lexicon" selected. I have created medicine.conf file and added medicine.res inside medicine folder.

image


My medicine.conf file look like:

# Bundle header
Bundle-Version: 1.3
Bundle-Name: medicine
Configuration-Script:
AddResDir ../resources/

# Configuration item #1
Name: text
Type: Text
Configuration-Script:
AddResource medicine/medicine.res
SetTextListSize 1
SetWordListSize 2
SetCharListSize 3

And in Activity I have set 

conf.setString("text.configuration.bundle", "medicine");

I have tested with 

Crocine Paracetamol


I am really lost with the documentation, please help 


Best Answer

Dear Dipannita Das,


thank you for contacting us and your question.


First, you can refer to other posts, that are about custom resources:

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

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


Based on these, you you have to question:

1-Do you want to recognize "an isolated" word by itself?

2-Do you want to recognize 2 or more words from your custom lexicon and no other words?

3-Or do you want to recognize one on several words from your lexicon it in a sentence mixed with "standard words"?


1-In that case, you shall ensure you attach the ak resource (en_US-ak-cur.res) to your configuratio. Indeed, this latter is mandatory. You configuration shall then be as:

# Bundle header
Bundle-Version: 1.3
Bundle-Name: medicine
Configuration-Script:
  AddResDir ../resources/

# Configuration item #1
Name: text
Type: Text
Configuration-Script:
  AddResource en_US/en_US-ak-cur.res
  AddResource medicine/medicine.res
  SetTextListSize 1
  SetWordListSize 2
  SetCharListSize 3


2-In that case, you shall add a GRM resource (as stated in above topics, it allows to "loop" over a lexicon), which will result in a configuration such as (replace GRM_PATH with the real path of your GRM):

# Bundle header
Bundle-Version: 1.3
Bundle-Name: medicine
Configuration-Script:
  AddResDir ../resources/

# Configuration item #1
Name: text
Type: Text
Configuration-Script:
  AddResource en_US/en_US-ak-cur.res
  AddResource medicine/medicine.res
  AddResource GRM_PATH/grm.res
  SetTextListSize 1
  SetWordListSize 2
  SetCharListSize 3


3-In the last case, ensure you add TEXT resource, which is a multiple purpose resource

# Bundle header
Bundle-Version: 1.3
Bundle-Name: medicine
Configuration-Script:
  AddResDir ../resources/

# Configuration item #1
Name: text
Type: Text
Configuration-Script:
  AddResource en_US/en_US-ak-cur.res
  AddResource medicine/medicine.res
  AddResource en_US/en_US-lk-text.res
  SetTextListSize 1
  SetWordListSize 2
  SetCharListSize 3


Best regards,


Olivier

1 Comment

Answer

Dear Dipannita Das,


thank you for contacting us and your question.


First, you can refer to other posts, that are about custom resources:

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

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


Based on these, you you have to question:

1-Do you want to recognize "an isolated" word by itself?

2-Do you want to recognize 2 or more words from your custom lexicon and no other words?

3-Or do you want to recognize one on several words from your lexicon it in a sentence mixed with "standard words"?


1-In that case, you shall ensure you attach the ak resource (en_US-ak-cur.res) to your configuratio. Indeed, this latter is mandatory. You configuration shall then be as:

# Bundle header
Bundle-Version: 1.3
Bundle-Name: medicine
Configuration-Script:
  AddResDir ../resources/

# Configuration item #1
Name: text
Type: Text
Configuration-Script:
  AddResource en_US/en_US-ak-cur.res
  AddResource medicine/medicine.res
  SetTextListSize 1
  SetWordListSize 2
  SetCharListSize 3


2-In that case, you shall add a GRM resource (as stated in above topics, it allows to "loop" over a lexicon), which will result in a configuration such as (replace GRM_PATH with the real path of your GRM):

# Bundle header
Bundle-Version: 1.3
Bundle-Name: medicine
Configuration-Script:
  AddResDir ../resources/

# Configuration item #1
Name: text
Type: Text
Configuration-Script:
  AddResource en_US/en_US-ak-cur.res
  AddResource medicine/medicine.res
  AddResource GRM_PATH/grm.res
  SetTextListSize 1
  SetWordListSize 2
  SetCharListSize 3


3-In the last case, ensure you add TEXT resource, which is a multiple purpose resource

# Bundle header
Bundle-Version: 1.3
Bundle-Name: medicine
Configuration-Script:
  AddResDir ../resources/

# Configuration item #1
Name: text
Type: Text
Configuration-Script:
  AddResource en_US/en_US-ak-cur.res
  AddResource medicine/medicine.res
  AddResource en_US/en_US-lk-text.res
  SetTextListSize 1
  SetWordListSize 2
  SetCharListSize 3


Best regards,


Olivier