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

Update Tokenizer.explain for special cases with whitespace #13086

Merged

Conversation

adrianeboyd
Copy link
Contributor

@adrianeboyd adrianeboyd commented Oct 25, 2023

Description

Update Tokenizer.explain to skip special case matches if the exact text has not been matched due to intervening whitespace.

Types of change

Bug fix, tests.

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.

Update `Tokenizer.explain` to skip special case matches if the exact
text has not been matched due to intervening whitespace.

Enable fuzzy `Tokenizer.explain` tests with additional whitespace
normalization.
@adrianeboyd adrianeboyd added bug Bugs and behaviour differing from documentation tests New, missing or incorrect tests feat / tokenizer Feature: Tokenizer labels Oct 25, 2023
@adrianeboyd adrianeboyd marked this pull request as draft October 26, 2023 07:21
@adrianeboyd adrianeboyd marked this pull request as ready for review November 6, 2023 11:56
Copy link
Contributor

@rmitsch rmitsch left a comment

Choose a reason for hiding this comment

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

Looks reasonable to me, but I'm lacking experience with the tokenizer.

spacy/tests/tokenizer/test_explain.py Show resolved Hide resolved
Copy link
Contributor

@rmitsch rmitsch left a comment

Choose a reason for hiding this comment

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

(Meant to approve before.)

@adrianeboyd adrianeboyd merged commit 0c25725 into explosion:master Nov 6, 2023
22 checks passed
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 / tokenizer Feature: Tokenizer tests New, missing or incorrect tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants