spraakbanken / korp-frontend

Frontend for Korp, a tool using the IMS Open Corpus Workbench (CWB).
https://spraakbanken.gu.se/en/tools/korp
MIT License
16 stars 8 forks source link

Use CQP parser from TEITOK #344

Open arildm opened 9 months ago

arildm commented 9 months ago

We parse CQP:s in the frontend in order to merge global filters (e.g. party filter for the vivill corpus), check for compatible features (free order) and to convert Korp-specific operators (&= etc). We implement this using PEG.js.

The TEITOK tool also does CQP (CQL) parsing using PEG.js. The main source code only includes the compiled PEG.js output but the PEG.js source code is also available in a separate repo.

It should be useful to examine similarities and differences. Perhaps they can be merged; both Korp and TEITOK could benefit from sharing a parsing library. And/or we could be helped by the cql_highlight.pegjs grammar which is supposed to yield HTML for syntax highlighting.

arildm commented 9 months ago

Switched from PEG.js to its compatible successor Peggy in c6d30eb7