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

Fix displacy span stacking #13068

Merged
merged 5 commits into from Nov 2, 2023

Conversation

rmitsch
Copy link
Contributor

@rmitsch rmitsch commented Oct 18, 2023

Description

Fix displacy span stacking by using the stack's last span's level instead of a counter not taking previous spans' levels into account.
Fixes #13056.

Before:
image

After:
image

Types of change

Bug fix

Checklist

  • I confirm that I have the right to submit this contribution under the project's MIT license.
  • I ran the tests, and all new and existing tests passed.
  • My changes don't require a change to the documentation, or if they do, I've added all required information.

@rmitsch rmitsch added bug Bugs and behaviour differing from documentation feat / visualizers Feature: Built-in displaCy and other visualizers labels Oct 18, 2023
@rmitsch rmitsch self-assigned this Oct 18, 2023
Copy link
Member

@svlandeg svlandeg left a comment

Choose a reason for hiding this comment

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

Is there a unit test we could write to double check this behaviour?

@rmitsch
Copy link
Contributor Author

rmitsch commented Oct 18, 2023

Is there a unit test we could write to double check this behaviour?

Added one. Also refactored the relevant functionality to allow checking the data prior to rendering it as HTML.

@shadeMe shadeMe merged commit c4e2daf into explosion:master Nov 2, 2023
15 checks passed
@rmitsch rmitsch deleted the fix/displacy-span-stacking branch November 2, 2023 11:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bugs and behaviour differing from documentation feat / visualizers Feature: Built-in displaCy and other visualizers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Displacy render: Spans are overlapped when rendered.
3 participants