Skip to content

Conversation

hippietrail
Copy link
Collaborator

Issues

#1511

Description

Attempt at implementing #1511

But it turns out there are many ways that a subject case pronoun can follow a preposition.
I tried to filter these out by calling .is_likely_homograph() and by checking which other POSes the preposition has.
But I passed more tests with a simple blacklist.

I left the other two approaches in the code along with a partial investigation of all POSes for all the known problematic prepositions.

In any case even though the sentences selected for unit tests pass, there are still many false positives in the snapshots for Alice in Wonderland and The Great Gatsby.

How Has This Been Tested?

I added unit tests from the issue and from the novels in our snapshot tests, but this is not sufficient.

Checklist

  • I have performed a self-review of my own code
  • I have added tests to cover my changes

Automattic#1511

I tried three different ways. The blacklist works best but feels heavy-handed or like "overfitting" to the given tests?

I kept the other two predicates commented out plus notes about the prepositions known to sometimes cause false positives with naïve pattern.
@hippietrail hippietrail added help wanted Extra attention is needed linting grammar An issue related to higher-level grammar checking labels Jul 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

grammar An issue related to higher-level grammar checking help wanted Extra attention is needed linting

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant