KorAP / Krill

:mag: A Corpus Data Retrieval Index using Lucene for Look-Ups
BSD 2-Clause "Simplified" License
15 stars 3 forks source link

SpanAtrributeQuery with Regex (CQP + PQ+) #95

Open margaretha opened 9 months ago

margaretha commented 9 months ago

CQP region e.g. sentence / element with regex attributes does not work.

Example query:

/region[<s (class="header")>]

Error message:

713, "SpanAttributeQuery only supports SpanTermQuery."

Akron commented 9 months ago

Same with PQ+ and <s (class='header')>.

The resulting koral query is currently

  "query": {
    "@type": "koral:span",
    "attr": {
      "@type": "koral:term",
      "foundry": "base",
      "key": "class",
      "layer": "s",
      "match": "match:eq",
      "type": "type:regex",
      "value": "header"
    },
    "wrap": {
      "@type": "koral:term",
      "attr": {
        "@type": "koral:term",
        "foundry": "base",
        "key": "class",
        "layer": "s",
        "match": "match:eq",
        "type": "type:regex",
        "value": "header"
      },
      "foundry": "base",
      "key": "s",
      "layer": "s"
    }
  }
}

Krill seems to have a problem with regex in that place. Works with <s (class='header')>.