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

Temporary fix for plural endings error. #6982

Merged
merged 10 commits into from
Aug 31, 2024

Conversation

Moderocky
Copy link
Member

Description

Some plural word endings are incorrectly detected, e.g. -us -> -i picks up "gui" as being a plural of (the well known word) "guus", and -fe -> -ves picks up "objectives" as being a plural of "objectife".

This PR patches these two cases for now (by adding an alternative first) and I've moved to a queue and a helper class rather than a fixed-size array to make the follow-up API a little easier: you should be able to add stuff to the beginning or end of the queue without trouble.

I'd like to follow up with a proper system for doing this a little more effectively, and the ability for addons to fix any of their own problematic cases by registering plural overrides.
That's probably out of scope for a patch version so it will likely be a 2.10 feature, maybe using some registrations stuff?


Target Minecraft Versions: any
Requirements: none
Related Issues: fixes #6981, fixes #5879

@Moderocky
Copy link
Member Author

So the test uses knife -> knives which was broken by the ive -> ives change.
It seems like there are significantly more ive words than ife words, so I chose to add the ife words manually.

They all seem to be compounds of *life, *wife or *knife so I just added those three endings. I did not add *rife because no compound word is ever a noun that would be pluralised.

@Moderocky Moderocky added bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. 2.9 Targeting a 2.9.X version release labels Aug 19, 2024
src/main/java/ch/njol/skript/util/Utils.java Outdated Show resolved Hide resolved
src/main/java/ch/njol/skript/util/Utils.java Outdated Show resolved Hide resolved
/**
* @param s trimmed string
* @param word trimmed string
* @return Pair of singular string + boolean whether it was plural
*/
@SuppressWarnings("null")
Copy link
Member

Choose a reason for hiding this comment

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

it'd be nice to move this to a noinspection if feasible

@Moderocky Moderocky added the patch-ready A PR/issue that has been approved and is ready to be merged/closed for the next patch version. label Aug 31, 2024
@Moderocky Moderocky merged commit febaf2e into SkriptLang:dev/patch Aug 31, 2024
6 checks passed
@Moderocky Moderocky deleted the temp-fix-for-guis branch August 31, 2024 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.9 Targeting a 2.9.X version release bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. patch-ready A PR/issue that has been approved and is ready to be merged/closed for the next patch version.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants