Skip to content

Commit 154d281

Browse files
committed
Add ambiguous pronoun rule
1 parent a3eb730 commit 154d281

File tree

4 files changed

+39
-0
lines changed

4 files changed

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

0 commit comments

Comments
 (0)