Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CQP: unnecesssary focus for spanNext #182

Open
margaretha opened this issue Mar 13, 2024 · 0 comments
Open

CQP: unnecesssary focus for spanNext #182

margaretha opened this issue Mar 13, 2024 · 0 comments

Comments

@margaretha
Copy link
Contributor

The following query returns error code 100 with message "null"

<s><corenlp/c=NP> "der"

The serialization includes a focus with multiple classes 200, that looks suspicious and unnecessary. This needs further investigation.

"serialQuery": "spanStartsWith(<tokens:base/s:s />, focus(200: spanNext({200: <tokens:corenlp/c:NP />}, {200: SpanMultiTermQueryWrapper(tokens:/s:der/)})))",
"query": {
    "@type": "koral:group",
    "frames": [
      "frames:startsWith",
      "frames:matches"
    ],
    "operands": [
      {
        "@type": "koral:span",
        "rewrites": [
          {
            "@type": "koral:rewrite",
            "operation": "operation:injection",
            "scope": "foundry",
            "src": "Kustvakt"
          }
        ],
        "wrap": {
          "@type": "koral:term",
          "foundry": "base",
          "key": "s",
          "layer": "s"
        }
      },
      {
        "@type": "koral:reference",
        "classRef": [
          200
        ],
        "operands": [
          {
            "@type": "koral:group",
            "operands": [
              {
                "@type": "koral:group",
                "classOut": 200,
                "operands": [
                  {
                    "@type": "koral:span",
                    "wrap": {
                      "@type": "koral:term",
                      "foundry": "corenlp",
                      "key": "NP",
                      "layer": "c"
                    }
                  }
                ],
                "operation": "operation:class"
              },
              {
                "@type": "koral:group",
                "classOut": 200,
                "operands": [
                  {
                    "@type": "koral:token",
                    "wrap": {
                      "@type": "koral:term",
                      "foundry": "opennlp",
                      "key": "der",
                      "layer": "orth",
                      "match": "match:eq",
                      "rewrites": [
                        {
                          "@type": "koral:rewrite",
                          "operation": "operation:injection",
                          "scope": "foundry",
                          "src": "Kustvakt"
                        }
                      ],
                      "type": "type:regex"
                    }
                  }
                ],
                "operation": "operation:class"
              }
            ],
            "operation": "operation:sequence"
          }
        ],
        "operation": "operation:focus"
      }
    ],
    "operation": "operation:position"
  }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant