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

Allow for counting multiple elements of the same kind in sequence rules #899

Open
1 task done
aireilly opened this issue Sep 20, 2024 · 0 comments
Open
1 task done

Comments

@aireilly
Copy link

Check for existing issues

  • Completed

Describe the feature

I am attempting to write a Vale rule to highlight ambiguous pronouns in a sentence. I want the rule to fire on a pronoun (PRP) or personal pronoun possessive (PRP$) only when it is preceded by 2 or more nouns in the sentence. I don't think this is possible currently. See https://studio.vale.sh/s/fa39e2d796458f6e8903cb5728807282

Note the last line in the fixture. The sequence rule doesn't handle multiple instances of the same POS tag.

Something like a min or max count field in the sequence rule would be useful for rules like this I think.

---
extends: sequence
message: "Avoid ambiguous pronouns"
level: warning
ignorecase: true
tokens:
  - tag: NN|NNP|NNPS|NNS|PERSON|GPE
    skip: 8
    min: 2
  - pattern: \w+
    tag: PRP|PRP$|WP|WP$|SYM
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant