File tree Expand file tree Collapse file tree 2 files changed +20
-8
lines changed
Expand file tree Collapse file tree 2 files changed +20
-8
lines changed Original file line number Diff line number Diff line change 5151
5252from proselint .registry .checks import Check , CheckResult , types
5353
54- POSSIBLE_PATTERN = r"possible(?!\s*\?)"
55-
5654COMPARATORS = (
5755 "most" ,
5856 "more" ,
8987 "paramount" ,
9088 "perfect" ,
9189 "perpetual" ,
92- POSSIBLE_PATTERN ,
90+ "possible" ,
9391 "preferable" ,
9492 "principal" ,
9593 "singular" ,
107105)
108106EXCEPTIONS = (
109107 ("more" , "perfect" ),
110- ("more" , POSSIBLE_PATTERN ),
108+ ("more" , "possible" ),
111109)
112110
113111
114112def _check_uncomparables (text : str , check : Check ) -> Iterator [CheckResult ]:
115- """Check the text."""
113+ """Check the text for uncomparables ."""
116114 return types .Existence (
117115 items = tuple (
118- rf"{ pair [0 ]} \s{ pair [1 ]} "
119- for pair in product (COMPARATORS , UNCOMPARABLES )
120- if pair not in EXCEPTIONS
116+ (
117+ rf"(?<!at\s)\bleast\s+{ adj } \b"
118+ if comp == "least"
119+ else rf"\b{ comp } \s+{ adj } \b"
120+ )
121+ for comp , adj in product (COMPARATORS , UNCOMPARABLES )
122+ if (comp , adj ) not in EXCEPTIONS
121123 )
122124 ).check (text , check )
123125
Original file line number Diff line number Diff line change 111111 "A more perfect union." ,
112112 "A more possible future." ,
113113 "But is it at least possible?" ,
114+ "It's at least possible for that thing to exist" ,
115+ (
116+ "It is at least possible of achievement and that our actions"
117+ "are at least possible contributions to bringing it about."
118+ ),
119+ (
120+ "It should be at least possible for the Department to improve"
121+ "its position and for the citizens generally to"
122+ "enjoy prosperity."
123+ ),
114124 ),
115125 ),
116126 (
You can’t perform that action at this time.
0 commit comments