Skip to content

Add ambiguous pronoun rule #943

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .vale/fixtures/RedHat/AmbiguousPronouns/.vale.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
; Vale configuration file to test the `AmbiguousPronouns` rule
StylesPath = ../../../styles
MinAlertLevel = suggestion
[*.adoc]
RedHat.AmbiguousPronouns = YES
16 changes: 16 additions & 0 deletions .vale/fixtures/RedHat/AmbiguousPronouns/testinvalid.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
The manager and the assistant reviewed the document, but she didn't approve it.
Alex told Jordan that he should study more.
The teacher gave Sarah her homework.
The robot and the cat went shopping, but he forgot his wallet.
John called Tom while he was driving.
Alex texted Jordan because he was late.
Tom gave Jerry his book.
John told Mark that he would win the prize.
Susan praised Lisa for her presentation.
The wind blew through the trees as it howled.
The teacher asked the student to submit her work by Friday.
The manager called the assistant when she needed the report.
When Sarah met Emma, she waved.
When the dog chased the cat, it ran away.
After the dog chased the cat, it hid under the couch.
If the robot and the cat go outside, they might get wet.
3 changes: 3 additions & 0 deletions .vale/fixtures/RedHat/AmbiguousPronouns/testvalid.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
John called Tom while Tom was driving.
The dog chased the cat.
John gave Lucy a book.
15 changes: 15 additions & 0 deletions .vale/styles/RedHat/AmbiguousPronouns.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
extends: sequence
message: "Avoid ambiguous pronouns. Replace with a specific noun that has a clear antecedent."
level: warning
ignorecase: true
tokens:
# First noun antecedent (common or proper, or named entity)
- tag: 'NN|NNP|NNPS|NNS|PERSON|GPE'
skip: 8
# Second noun antecedent
- tag: 'NN|NNP|NNPS|NNS|PERSON|GPE'
skip: 8
# Ambiguous pronoun
- pattern: '\b(it|its|they|he|she|his|her|their)\b'
tag: 'PRP|PRP\$'
Loading