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

Removes hyphens from the keyphrase before checking if slug contains keyphrase #17424

Merged
merged 2 commits into from
Sep 10, 2021

Conversation

agnieszkaszuba
Copy link
Contributor

@agnieszkaszuba agnieszkaszuba commented Sep 9, 2021

Context

Summary

This PR can be summarized in the following changelog entry:

  • [yoastseo] Removes hyphens from a keyphrase for the Keyphrase in slug assessment. Also removes the functionality that would look for the keyphrase in the unparsed slug if it was not found in the parsed slug, as it is made redundant by the new functionality.
  • Improves the accuracy of the Keyphrase in slug assessment by correctly detecting multi-word keyphrases with at least one hyphenated word in the slug.

Relevant technical choices:

  • The functionality for searching for a keyphrase in the unparsed slug was removed because it is made redundant by the dehyphenating functionality.
  • The function for dehyphenating keyphrases from the original PR was adapted so that words with more than one hyphen (e.g. mother-in-law) are also fully dehyphenated.

Test instructions

Test instructions for the acceptance test before the PR gets merged

This PR can be acceptance tested by following these steps:

  • Make sure that the Keyphrase in slug assessment returns a green bullet in all the following cases:
    • Both the keyphrase and the slug are pop-art.
    • The keyphrase is modern pop-art and the slug is modern-pop-art.
    • Both the keyphrase and the slug are mother-in-law.
    • The keyphrase is gift ideas for mother-in-law and father-in-law and the slug is gifts-for-mother-and-father-in-law

Test instructions for QA when the code is in the RC

  • QA should use the same steps as above.

QA can test this PR by following these steps:

Impact check

This PR affects the following parts of the plugin, which may require extra testing:

UI changes

  • This PR changes the UI in the plugin. I have added the 'UI change' label to this PR.

Documentation

  • I have written documentation for this change.

Quality assurance

  • I have tested this code to the best of my abilities
  • I have added unittests to verify the code works as intended

Fixes https://yoast.atlassian.net/browse/LINGO-209

This replaces the old functionality for looking for the keyphrase in the unparsed slug. The added advantage is that the new function also finds a match when the keyphrase consists of a hyphenated word plus a regular word
@agnieszkaszuba agnieszkaszuba added the changelog: enhancement Needs to be included in the 'Enhancements' category in the changelog label Sep 10, 2021
Copy link
Contributor

@FAMarfuaty FAMarfuaty left a comment

Choose a reason for hiding this comment

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

CR & Acceptance 👍

@FAMarfuaty FAMarfuaty merged commit fc6bd56 into trunk Sep 10, 2021
@FAMarfuaty FAMarfuaty deleted the LINGO-209-recognise-hyphenated-keyphrases-in-slug branch September 10, 2021 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog: enhancement Needs to be included in the 'Enhancements' category in the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants