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

Ensure placeholders with and without context are found correctly #29

Merged
merged 1 commit into from May 29, 2019

Conversation

iwootten
Copy link
Contributor

@iwootten iwootten commented May 22, 2019

What is the context of this PR?

The previous placeholder extraction wrongly assumed that placeholders would never require context (i.e Be part of an answer). This change seeks to correct that.

Instead of searching for placeholders using the 'text' key as part of a no_context key search, it searches for placeholders and filters them into separate lists dependant on whether they require context.

How to review?

The new unit test (taken from census individual) includes keys that require both context and don't so should now cover both use cases. See if you agree with the approach.

@iwootten iwootten changed the title Ensure placeholders with and without context are found correctly Correct Placeholder and Variant Extraction May 24, 2019
@iwootten iwootten changed the title Correct Placeholder and Variant Extraction Ensure placeholders with and without context are found correctly May 24, 2019
Copy link
Contributor

@bitdivision bitdivision left a comment

Choose a reason for hiding this comment

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

Looks good.

@bambrp bambrp self-requested a review May 28, 2019 14:49
Copy link
Member

@bambrp bambrp left a comment

Choose a reason for hiding this comment

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

This resolves the issue for me, tried test on old code, it breaks, new code, it passes cleanly (except for the double-quote expected failure, of course).

@iwootten iwootten force-pushed the eq-3025-fix-placeholder-translation branch from c67d72a to 4262fca Compare May 29, 2019 12:26
@bitdivision bitdivision merged commit 823c8b7 into v3 May 29, 2019
@bitdivision bitdivision deleted the eq-3025-fix-placeholder-translation branch May 29, 2019 12:28
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.

None yet

3 participants