Debian Codegraph @

proselint/checks/misc/illogic.py

raw
1 """Illogic.
2
3 ---
4 layout: post
5 source: Garner's Modern American Usage
6 source_url: http://bit.ly/1T4alrY
7 title: Illogic
8 date: 2014-06-10 12:31:19
9 categories: writing
10 ---
11
12 Archaism.
13
14 """
15 from proselint.tools import existence_check, memoize
16
17
18 @memoize
19 def check(text):
20 """Check the text."""
21 err = "misc.illogic"
22 msg = "'{}' is illogical."
23
24 illogics = [
25 "preplan",
26 "more than .{1,10} all",
27 "appraisal valuations?",
28 "(?:i|you|he|she|it|y'all|all y'all|you all|they) could care less",
29 "least worst",
30 "much-needed gaps?",
31 "much-needed voids?",
32 "no longer requires oxygen",
33 "without scarcely",
34 ]
35
36 return existence_check(text, illogics, err, msg, offset=1)
37
38
39 @memoize
40 def check_coin_a_phrase_from(text):
41 """Check the text."""
42 err = "misc.illogic.coin"
43 msg = "You can't coin an existing phrase. Did you mean 'borrow'?"
44
45 regex = "to coin a phrase from"
46
47 return existence_check(text, [regex], err, msg, offset=1)
48
49
50 @memoize
51 def check_without_your_collusion(text):
52 """Check the textself."""
53 err = "misc.illogic.collusion"
54 msg = "It's impossible to defraud yourself. Try 'aquiescence'."
55
56 regex = "without your collusion"
57
58 return existence_check(
59 text, [regex], err, msg, require_padding=False, offset=-1)