Skip to content

Undocumented feature for multiple parallel corpora #46

@julesbouton

Description

@julesbouton

Hi,
I'm currently using the korp-backend without the frontend for parallel corpora, and I struggle with parallel queries on multiple corpora.

The syntax described in the manual for CQP queries doesn't work if you have multiple corpora. The following works fine with one corpus, but that's all. If you add another corpus, it is unclear which corpus is aligned with which one and the cqp parser struggles:

[lemma="kala"] :OTHER-EN [lemma="fish"]

However, playing with queries sent by the korp frontend, it seems that the API was in fact scaled for multiple parallel corpora. This queries two parallel corpora at once for instance.

I found nothing about this (nice) feature in the API doc, and the syntax is not completely self-explanatory. Is this an undocumented Korp feature, or a CQP feature which I missed? At least the code below seems to indicate how it works. Still, it would be nice to have a clear description of this somewhere!

# Handle aligned corpora
if "|" in corpus:
linked = corpus.split("|")
cqpnew = []

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions