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
Glossary: Match by glossary terms already suffixed #1795
Draft
pedro-mendonca
wants to merge
28
commits into
GlotPress:develop
Choose a base branch
from
pedro-mendonca:issue-suffixes
base: develop
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Identify if a glossary term is in a suffixed form according to the existent suffix rules, and revert it to the unsuffixed form.
Afterwards, run the regular matching for terms with suffixes.
This improves the glossary matching for cases where the terms aren't in the base form, for example, for nouns in plural and for verbs in past tense.
It will first revert the verb to infinitive, allowing next to match to all the other known regular forms included in the rules.
Problem
Since #1373 it's possible to match terms to similar words, depending of the rules set for each part_of_speech.
Currently the match only works if the glossary entry is the base term:
If a noun glossary term is introduced in plural form, or a verb is not in infinitive, it will only match those exact terms, not being able to match other known regular forms.
Solution
Before try to match to suffixed terms, try to match the term to a suffixed form and use the same rules to revert to the base form. And afterwards, proceed the same by matching any possible suffixed terms.
Added a test
check_map_glossary_from_suffixed()
that picks each glossary suffixed term and uses it for the test instead of the base term, than runs the regularcheck_map_glossary()
glossary match test to check if all the terms are matched as previoulsy.All the current test cases are passing.Testing Instructions
Fixes #1794