-
Notifications
You must be signed in to change notification settings - Fork 129
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
1372: Add suffixes for matching glossary terms #1373
Conversation
@ocean90 I've made a big change by separating terms by type, with more clear lists that we can keep or comment out, for testing. Let me know your thoughts on this please. |
I like the direction where this goes! But please make sure you update your branch with the latest changes from #1395 as it changes how |
@pedro-mendonca Do you plan to continue working on this? Do you need any help? |
Hi, I do, just had no time yet. I'll get back to it. |
@ocean90 I have a .po with a set of originals and a .csv for the glossary to test this. |
After looking at most rules, I've made an array of rules with the same structure:
Then I made a single logic that runs on every set of rules, for every We can add rules or remove them by adding or removing these arrays. Feedback please :) |
@ocean90 I've added all the Unit Tests for the suffixes, for nouns and verbs. |
@amieiro I've completed the full update related to your above suggestions. NOUNSHere is a summary:
Fixed, removed all the entries and tests, old and new, about the irregular noun plurals for 'man' and 'woman'.
Fixed, removed the exception 'an'. No need to add 'f', as it's matched by the fallback default '-s'.
Not added, as it's not a regular case. VERBS
Fixed, removed the '-ss' and added '-s' to match both situations. Added case bias and focus.
Fixed: Now the ending values don't use null if no changes, now it has support for placeholders (%s or %1$s) to allow using the current ending, and duplicating for the case of doubling the ending consonants (committed, committing, etc.). The vowel-l case is matched in the added rules. As you've mentioned, it's not simple to detect the stressed syllable, so there are two matches for both single and double ending consonant. TESTINGCreated the function At last, do you think it would be usefull to add to the Thank you for your compreehensive review! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Related with the .pot and .csv files in the tests/phpunit/data
, as we don't use it in the automatic test, I suggest you to remove it from the PR and add it to a GitHub Gist or to a own repo. I think a good option is to add them in a GitHub Gist, so we can update it easily and discuss. But I think the best option will be to read both files in each test and using their data instead of hard-coding them (we can do this in a different PR).
Hi @amieiro, thanks for your review!! |
These changes requested have been done in the next commits.
Add suffixes to matching glossary terms.
Nouns
https://www.thefreedictionary.com/Forming-Plurals.htm
https://preply.com/en/blog/simple-rules-for-the-formation-of-plural-nouns-in-english/
Plurals of singular nouns
E.g.: Kiss and kiss-es, waltz and waltz-es, box and box-es, dish and dish-es, coach and coach-es.
E.g.: Delay and delay-s, key and key-s, toy and toy-s, guy and guy-s.
E.g.: Lady and ladi-es, hero, tomato.
E.g.: Woman and wom-en.
E.g.: Wife and wiv-es, leaf and leav-es, wolf and wolv-es, bus and bus-es.
Verbs
Third-person singular
E.g.: Pass and pass-es, quiz and quiz-es, fix and fix-es, push and push-es, watch and watch-es.
E.g.: Play and play-s.
E.g.: Try and tri-es, Go and go-es, do and do-es.
E.g.: Format and format-s, make and make-s, pull and pull-s
Past simple tense and past participle. Suffix '-ed'.
E.g.: Fix and fix-ed, push and push-ed.
E.g.: Contribute and contribut-ed, delete and delet-ed.
Present participle and gerund. Suffix '-ing'.
E.g.: Fix and fix-ing, push and push-ing.
E.g.: Agree and agree-ing, see and see-ing, dye and dye-ing, tiptoe and tiptoe-ing.
E.g.: Contribute and contribut-ing, delete and delet-ing, care and car-ing. Change to '-ing'.
Nouns formed by Verbs
https://www.thefreedictionary.com/Commonly-Confused-Suffixes-tion-vs-sion.htm
Check the complete list below.
Check the complete list below.
Hooks
gp_glossary_match_suffixes()
to allow customization.Fixes #1384, #1386 and #1372