iink SDK on Device

Answered

Adding new word to existing resource file

Hello!

As per the Documentation of iink sdk version 1.3  we tried to add new Text Lexicon in existing resource file.

 RecognitionAssetsBuilder recognitionAssetsBuilder = engine.createRecognitionAssetsBuilder();

        String newText = "myWord";

        recognitionAssetsBuilder.compile("Text Lexicon", newText);

           try {

            recognitionAssetsBuilder.store("/storage/emulated/0/assets/resources/en_US/en_US-aths.res");

         } catch (IOException e) {

            e.printStackTrace();

        }

What we could observe is that it is replacing the existing content. We also make corresponding changes in config file. 

Please let me know if i am doing wrong ,or is there way to add my word to existing resource file.

Thanks 

Pankaj Tyagi


Best Answer

Dear Pankaj,


Thank you for contacting us.


Currently, our RecognitionAssetsBuilder doesn't allow to add a single word to an existing resource. In the current case, you are indeed erasing your existing resource.


You should create your own lexicon as follows:

String newText = "myWord1\nmyWord1\n ... myWordn\n";


You can then compile it and add it to your configuration.


Best regards,


Olivier

1 Comment

Answer

Dear Pankaj,


Thank you for contacting us.


Currently, our RecognitionAssetsBuilder doesn't allow to add a single word to an existing resource. In the current case, you are indeed erasing your existing resource.


You should create your own lexicon as follows:

String newText = "myWord1\nmyWord1\n ... myWordn\n";


You can then compile it and add it to your configuration.


Best regards,


Olivier