Búsqueda en un json/hash

HMG en Español

Moderator: Rathinagiri

Post Reply
User avatar
AidTIC
Posts: 117
Joined: Mon Apr 22, 2013 8:29 am
DBs Used: DBF
Contact:

Búsqueda en un json/hash

Post by AidTIC »

hola,

Tengo este json y necesito buscar por ejemplo la palabra "uno" y saber en que "normalizedVertices" esta.

Gracias

Code: Select all

MSGINFO(ASCAN(jDocument , {| e | e ==  "una" } ) )  // me devuelve siempre 0

Code: Select all

{
  "responses":
  [
    {
      "fullTextAnnotation":
      {
        "pages":
        [
          {
            "width": 595,
            "height": 841,
            "blocks":
            [
              {
                "boundingBox":
                {
                  "normalizedVertices":
                  [
                    {
                      "x": 0.14285715,
                      "y": 0.086801425
                    },
                    {
                      "x": 0.28235295,
                      "y": 0.086801425
                    },
                    {
                      "x": 0.28235295,
                      "y": 0.09750297
                    },
                    {
                      "x": 0.14285715,
                      "y": 0.09750297
                    }
                  ]
                },
                "paragraphs":
                [
                  {
                    "boundingBox":
                    {
                      "normalizedVertices":
                      [
                        {
                          "x": 0.14285715,
                          "y": 0.086801425
                        },
                        {
                          "x": 0.28235295,
                          "y": 0.086801425
                        },
                        {
                          "x": 0.28235295,
                          "y": 0.09750297
                        },
                        {
                          "x": 0.14285715,
                          "y": 0.09750297
                        }
                      ]
                    },
                    "words":
                    [
                      {
                        "boundingBox":
                        {
                          "normalizedVertices":
                          [
                            {
                              "x": 0.14285715,
                              "y": 0.086801425
                            },
                            {
                              "x": 0.17310925,
                              "y": 0.086801425
                            },
                            {
                              "x": 0.17310925,
                              "y": 0.09512485
                            },
                            {
                              "x": 0.14285715,
                              "y": 0.09512485
                            }
                          ]
                        },
                        "text": "Esto"
                      },
                      {
                        "boundingBox":
                        {
                          "normalizedVertices":
                          [
                            {
                              "x": 0.17983194,
                              "y": 0.089179546
                            },
                            {
                              "x": 0.19327731,
                              "y": 0.089179546
                            },
                            {
                              "x": 0.19327731,
                              "y": 0.09512485
                            },
                            {
                              "x": 0.17983194,
                              "y": 0.09512485
                            }
                          ]
                        },
                        "text": "es"
                      },
                      {
                        "boundingBox":
                        {
                          "normalizedVertices":
                          [
                            {
                              "x": 0.2,
                              "y": 0.089179546
                            },
                            {
                              "x": 0.22521009,
                              "y": 0.089179546
                            },
                            {
                              "x": 0.22521009,
                              "y": 0.09512485
                            },
                            {
                              "x": 0.2,
                              "y": 0.09512485
                            }
                          ]
                        },
                        "text": "una"
                      },
                      {
                        "boundingBox":
                        {
                          "normalizedVertices":
                          [
                            {
                              "x": 0.23361345,
                              "y": 0.086801425
                            },
                            {
                              "x": 0.28235295,
                              "y": 0.086801425
                            },
                            {
                              "x": 0.28235295,
                              "y": 0.09750297
                            },
                            {
                              "x": 0.23361345,
                              "y": 0.09750297
                            }
                          ]
                        },
                        "text": "prueba"
                      }
                    ],
                    "text": "Esto es una prueba "
                  }
                ],
                "blockType": "TEXT",
                "text": "Esto es una prueba  \r"
              }
            ]
          }
        ],
        "text": "Esto es una prueba\n"
      },
      "context":
      {
        "uri": "gs://hopeful-buckeye-306422/prueba.pdf",
        "pageNumber": 1
      }
    }
  ]
}

Skydone Solutions
www.skydone.com
Post Reply