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

Gracefully handle surrogate replacement for shuffle without choices #22

Merged
merged 1 commit into from
Sep 4, 2020

Conversation

jantrienes
Copy link
Collaborator

For tags without a special surrogate generator, we shuffle annotations across the entire corpus. To prevent an annotation from remaining in the original document, we exclude the annotation from the set of choices. This strategy breaks when an annotation is unique in the corpus. This commit fixes the issue by falling back to the IdentityGenerator when choices are empty. A warning is raised to the user.

For tags without a special surrogate generator, we shuffle annotations across the entire corpus. To prevent an annotation from remaining in the original document, we exclude the annotation from the set of choices. This strategy breaks when an annotation is unique in the corpus. This commit fixes the issue by falling back to the IdentityGenerator when `choices` are empty. A warning is raised to the user.
@jantrienes jantrienes merged commit 0b3c14a into master Sep 4, 2020
@jantrienes jantrienes deleted the surrogate-generator-handle-empty-choices branch September 4, 2020 07:18
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