Text

EditView

How do I control when handwriting recognition occurs?Control when the engine works?I want to pass the dots to the engine during the handwriting process, and I decide when the engine starts to recognize.Because if the engine passes points in real time, it will always have event feedback.


Dear Gang Chen,


Currently, the solution we would recommend is that you add your strokes using the batch mode (https://developer.myscript.com/docs/interactive-ink/1.3/android/advanced/off-screen-usage/). You can then add the strokes when you prefer and export the result to get it and display it according to your needs. You can find a code sampe that explains how yo proceed:
https://github.com/MyScript/interactive-ink-additional-examples-android/tree/master/java/samples/batch-mode


Please note that when adding huge amount of ink at once, recognition can take long time.


Let me know if this helps.


Best regards,


Olivier

How to configure the engine to recognize other languages, such as Japanese.

Dear Gang Chen,


in order to use the Japanese language, please proceed as follows:

-First, I recommend you refer to the following documentation: https://developer.myscript.com/docs/interactive-ink/1.3/android/advanced/custom-recognition/

-Then, please download the 1.3 Japanese asset from https://developer.myscript.com/support/recognition-assets where version 1.3, Languages and Japanese shall be selected:

-The downloaded archive is named  myscript-iink-recognition-text-ja_JP.zip. It contains the conf and  resources files to be extracted in your project directory.

-Extract it into your Android project, which should now look like:

-Last, set the "ja_JP" string as "lang" configuration: conf.setString("lang","ja_JP");


Let us know if this helps.


Best regards,


Olivier

How does the handwriting engine dynamically set the recognition language, for example, when the system is switched from Chinese to English, the engine is also switched from Chinese to English.

Thank you!

Dear Gang Chen,


Thank you for your question.


Yes it is possible to switch dynamically the language configuration. We recommand you performing the configuration at editor level. 


The configuration must be applied before setting the part to the editor. So if we suppose you want to apply English to an application that was already having a "Text" Content Part in another language, after detecting the system language change, the code to be called to update the language could look like:



void switchLanguageConfiguration()
{
  Editor editor = editorView.getEditor();
  Configuration conf = editor.getConfiguration();
  String confDir = "zip://" + getPackageCodePath() + "!/assets/conf";
  conf.setStringArray("configuration-manager.search-path", new String[]{confDir});
  String tempDir = getFilesDir().getPath() + File.separator + "tmp";
  conf.setString("content-package.temp-folder", tempDir);

  conf.setString("lang","ja_JP");
  conf.setString("text.configuration.bundle","en_US");
  conf.setString("text.configuration.name","text");


if (contentPart != null)
  {
contentPart.close();
contentPart = null;
  }
contentPart = contentPackage.getPart(0);

if (contentPart != null)
  {
contentPart.close();
contentPart = null;
  }

  editor.setPart(null);
  editor.clear();

    contentPart = contentPackage.createPart("Text");

  editor.setPart(contentPart);


}


Regards,


Gwenaëlle



image For example, how does the Hello World user app get, is there a notification event.


Login or Signup to post a comment