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

T report undefined corpora #20

Draft
wants to merge 3 commits into
base: dev
Choose a base branch
from

Conversation

mmatthiesencsc
Copy link

The first PR of today's "Helsinki Hackathon":
This PR makes the backend more resilient to queries for missing corpora.
It also adds the option of a more verbose error message.
It adds the "strict" parameter to the backend API
WIP: this still needs to be documented.

korp/cwb.py:
- CWB.run_cqp: Add keyword argument "errors": if "report", report errors
  at the beginning of the output as lines beginning with "CQP Error:";
  if "ignore", ignore errors; if "strict", throw CQPError (the default,
  as before).
korp/views/info.py:
- /corpus_info: If the parameter "report_undefined_corpora" is true,
  add to the result the item "undefined_corpora" listing the undefined
  corpora in the parameter "corpus", instead of an error when a corpus
  is undefined. The configuration variable
  CHECK_AVAILABLE_CORPORA_STRICTLY controls how strictly the available
  corpora are checked.
korp/views/info.py:
- /info: If the parameter "strict" is true, filter out undefined
  (inaccessible) corpora from the result.
@MartinHammarstedt
Copy link
Member

This seems like a good improvement. The pull request is marked as a draft and therefore can't currently be merged. Are you planning on doing any further work on this, or should we just go ahead and merge it as it is?

@janiemi
Copy link

janiemi commented Aug 14, 2024

Great! My intention has been to augment the API documentation to cover the additions, but I haven’t got to doing that yet. I’ll also check if there was something else to do before converting this to a non-draft pull request.

@janiemi janiemi mentioned this pull request Aug 15, 2024
@janiemi
Copy link

janiemi commented Aug 15, 2024

In fact, I’d prefer having #21 merged before this, so that it would be easier to add some tests for the changes.

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

Successfully merging this pull request may close these issues.

3 participants