MyScript iink SDK Web REST Text recognition example

Considering this request body.

rest-text-example.json
{
  "configuration": {
    "lang": "en_US",
    "text": {
      "guides": {
        "enable": true
      },
      "eraser": {
        "erase-precisely": false
      },
      "margin": {
        "top": 20,
        "left": 10,
        "right": 10,
        "bottom": 10
      },
      "mimeTypes": [
        "text/plain"
      ]
    },
    "export": {
      "image-resolution": 300,
      "jiix": {
        "bounding-box": false,
        "strokes": false,
        "ids": false,
        "full-stroke-ids": false,
        "text": {
          "chars": false,
          "words": true
        }
      }
    }
  },
  "xDPI": 96,
  "yDPI": 96,
  "contentType": "Text",
  "height": 193,
  "width": 2560,
  "strokeGroups": [
    {
      "penStyle": "color: #000000;\nwidth: 1.8897637795275593;\n-myscript-pen-width: 1;\n-myscript-pen-fill-style: none;\n-myscript-pen-fill-color: #FFFFFF00;",
      "strokes": [
        {
          "id": "stroke-acfffb46-353a-4aad-af9d-9b2ea5f0669f",
          "pointerType": "mouse",
          "p": [
            1,
            0.83,
            0.74,
// Open the file to see the full content (1,607 lines)

The strokes in the strokeGroups of this request correspond to that writing:

The text/plain result of the recognition is the sentence "Hello, how are you?".

Following is the result if you ask for application/vnd.myscript.jiix output.

For the sake of simplicity, the char and stroke details were disabled in the following jiix output. Follow this link if you want to see all the details that can be computed in text recognition.

rest-text-jiix-full-output.json
{
  "type": "Text",
  "label": "Hello, how are you?",
  "words": [
    {
      "label": "Hello",
      "candidates": [
        "Hello",
        "Heleo",
        "Helto",
        "Helle",
        "Hella"
      ],
      "items": [
        {
          "timestamp": "2024-07-03 12:28:11.214000",
          "X": [
            161.395828,
            161.395828,
            161.395828,
            161.395828,
            161.395828,
            161.395828,
            161.395828,
            161.395828,
            161.395828,
            160.866669,
            160.866669,
            160.602081
          ],
          "Y": [
            7.14374971,
            7.9375,
            9.26041603,
            10.583333,
            12.9645834,
            15.0812492,
            18.7854156,
            22.2249985,
            25.6645832,
            27.78125,
            29.6333332,
            30.9562492
          ],
          "F": [
            1,
            0.829999983,
            0.74000001,
            0.74000001,
            0.810000002,
// Open the file to see the full content (1,663 lines)
{
 "type": "Text",
 "label": "Hello, how are you?",
 "words": [ {
   "label": "Hello",
   "candidates": [ "Hello", "Heleo", "Helto", "Helle", "Hella" ]
  }, {
   "label": ",",
   "candidates": [ ",", ".", ";", "-", "s" ]
  }, {
   "label": " "
  }, {
   "label": "how",
   "candidates": [ "how", "hou", "Low", "How", "kow" ]
  }, {
   "label": " "
  }, {
   "label": "are",
   "candidates": [ "are", "aree", "aure", "aire", "Are" ]
  }, {
   "label": " "
  }, {
   "label": "you",
   "candidates": [ "you", "sou", "your", "yon", "zou" ]
  },
  {
   "label": "?",
   "candidates": [ "?", "!", "7", ".?", "?." ]
  } ],
 "version": "3",
 "id": "MainBlock"
}