iink SDK on Device

Answered

Code to set candidate words and dictionary

Android platform, how to set the number of candidate words through code, add dictionary through code, for example, I am using English, and now I need to be able to identify α, β, Σ. and other math symbols, addresouse math by code without modifying the conf file


Best Answer

Dear Qiaodenghui,

Thank you for contacting us.

Currently, the number of word candidates can not be tuned via the API, it can only be set in the configuration file of the language:

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

I am using English, and now I need to be able to identify a, ß, S
>>First, as you are probably aware, our technology used country specific languages. For each language, we suppoort a limited set of characters.
For example, in the case of the en_US language, we support digits, emojis, punctuation, symbols (!"#$%&'()*+,-_./:;<=>?@[\]^{}~€¢£¥§×µ±÷|•←→↳⇐⇒✓°↑↓≠⊕⊖∅↔≈≥≤↗↘⇔♀♂◦☆) and the following latin characters (abcdefghijklmnopqrstuvwxyzé).
It is not possible to add a character not beloging to the default ones. You then understand you will not be able to recognize the α, β, Σ characters.
In the same way, if you want to add a custom dictionary/lexicon, this cannot be done via the code but only using a compiled resource:
-The resource shall be added in the assets of your project
-You shall then add it in the conf file:
E.g:
Name: text
Type: Text
Configuration-Script:
AddResource en_US/en_US-ak-cur.res
AddResource en_US/en_US-lk-text.res
AddResource my_RES/myCustomResource.res
SetTextListSize 1
SetWordListSize 5
SetCharListSize 1


Let us know if you have other questions.

Best regards,

Olivier

1 Comment

Answer

Dear Qiaodenghui,

Thank you for contacting us.

Currently, the number of word candidates can not be tuned via the API, it can only be set in the configuration file of the language:

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

I am using English, and now I need to be able to identify a, ß, S
>>First, as you are probably aware, our technology used country specific languages. For each language, we suppoort a limited set of characters.
For example, in the case of the en_US language, we support digits, emojis, punctuation, symbols (!"#$%&'()*+,-_./:;<=>?@[\]^{}~€¢£¥§×µ±÷|•←→↳⇐⇒✓°↑↓≠⊕⊖∅↔≈≥≤↗↘⇔♀♂◦☆) and the following latin characters (abcdefghijklmnopqrstuvwxyzé).
It is not possible to add a character not beloging to the default ones. You then understand you will not be able to recognize the α, β, Σ characters.
In the same way, if you want to add a custom dictionary/lexicon, this cannot be done via the code but only using a compiled resource:
-The resource shall be added in the assets of your project
-You shall then add it in the conf file:
E.g:
Name: text
Type: Text
Configuration-Script:
AddResource en_US/en_US-ak-cur.res
AddResource en_US/en_US-lk-text.res
AddResource my_RES/myCustomResource.res
SetTextListSize 1
SetWordListSize 5
SetCharListSize 1


Let us know if you have other questions.

Best regards,

Olivier