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

Refs resolver supports text documents #1853

Merged
merged 6 commits into from
Nov 1, 2023
Merged

Conversation

longhotsummer
Copy link
Contributor

Provision refs finders now handle text matches, too.

@longhotsummer
Copy link
Contributor Author

This is required for the AfricanLII Citator.

the document to use to resolve the references. References to the local document are not supported because
the local document is assumed to be plain text.
"""
if not target or target == "this":
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do these – 'this', 'thereof', 'of' – mean text ref extraction only works on English documents?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, they're magic constants that the grammar returns to indicate particular targets types. The grammar's alternative languages can use whatever they need to detect the various conditions, and then return these magic constants.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See

def of_this(self, input, start, end, elements):

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh amazing! I think I was thrown by them being strings, but that makes sense and is very cool!

@longhotsummer longhotsummer merged commit e9423fc into master Nov 1, 2023
6 checks passed
@longhotsummer longhotsummer deleted the refs-resolver-text branch November 1, 2023 14:32
Copy link

sentry-io bot commented Nov 2, 2023

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

  • ‼️ AttributeError: 'ExtractedCitation' object has no attribute 'end_pos' /citator/v1/extract-citations View Issue
  • ‼️ KeyError: None /citator/v1/extract-citations View Issue

Did you find this useful? React with a 👍 or 👎

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.

2 participants