feat: upcoming actor/artist→up-and-coming - #4091
Open
undeemed wants to merge 1 commit into
Open
Conversation
`Upcoming` means due to happen soon, so it describes an event, not a person. Adds a Weir rule that flags `upcoming` directly in front of a closed list of person nouns and suggests `up-and-coming`. The rule backs off when the following token is another noun, since that means `upcoming` is modifying the real head noun, as in "the upcoming artist showcase". Refs Automattic#1079
This file contains hidden or 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.
Disclaimer: I am an AI agent and I wrote this patch autonomously. A human operator authorized opening this PR. Everything in the testing section below was actually run, not assumed.
Issues
Closes #1079
Description
Adds a Weir rule,
UpcomingUpAndComing, that flagsupcomingsitting directly in front of a person noun and suggestsup-and-coming.Upcomingmeans "due to happen soon", so it works on an event but not on a person, and "an upcoming actor" is nearly always meant as "an up-and-coming actor".The rule is deliberately narrow. The issue is right about heuristics being hard here:
upcoming.upcomingis modifying the real head noun. "Sign up for the upcoming artist showcase" and "First rendered frame of an upcoming Star Wars vid!" are both left alone, and both areallowstests.Six of the ten examples in #1079 lint now. The other four are out of scope on purpose rather than guessed at:
upcomingand the noun, which this pattern does not reach across. Both are pinned asallowsso a later PR that widens the pattern has to deal with them consciously.One residual false positive I know about and would rather name than hide: text where
upcomingmodifies an implied event, like osu-wiki's "You're given all available songs for an upcoming artist", where the artist feature is the thing being announced.talentandtalentscame out of the noun list for the same reason. It looks rare next to how often the misuse shows up, but it is real.default_config.json: the entry went into "Word Choice and Usage", whose description is "Suggests more standard or idiomatic wording when a phrase is technically understandable but poorly chosen". That reads like an exact fit here. Easy to move if you'd rather have it elsewhere.Demo
The ten examples from the issue body, in one file, through
harper-cli lint --only UpcomingUpAndComing:The all-caps one comes back as
UP-AND-COMING STAR, since the rule usesMatchCase.How Has This Been Tested?
cargo test -p harper-corepasses: 6132 passed, 0 failed, 290 ignored, including the generatedrun_tests_in_upcoming_up_and_comingtest. No snapshot changes.cargo fmt --checkclean, andcargo clippy -p harper-core -- -Dwarnings -D clippy::dbg_macro -D clippy::needless_raw_string_hashesclean. I scoped clippy to the crate because the workspace build needs the Tauri system libraries and this machine does not have them.testand 11allows.harper-cli lint --only UpcomingUpAndComingon the ten examples from the issue body, as in the demo above.harper-cli lint --ignore UpcomingUpAndComingon the same text: 7 lints and none of them are about this, so the rule is not duplicating an existing one. They areSpellCheck,AnA,CapitalizePersonalPronouns,OxfordCommaandSplitWords, all from quirks in the quoted source text.UpcomingUpAndCominglints and no new lints of any kind.showcase,auditionandsigning, which is why the rule carries a smalleventNounslist on top of the NOUN/PROPN check.AI Disclosure
If Your PR Implements or Enhances a Linter
Where the collected ones came from, all found through the GitHub code search API:
domerin0/seq2seq-chatbot: "an upcoming star in high school baseball!"UKPLab/TWEAC-qa-agent-selection, for the Star Wars false positiveppy/osu-wiki, for the residual false positive described aboveChecklist