Debian Codegraph @

proselint/checks/misc/inferior_superior.py

raw
1 """Inferior / Superior.
2
3 ---
4 layout: post
5 source: Fowler's Modern English Usage
6 source_url: bit.ly/1YBG8QJ
7 title: Inferior / Superior
8 date: 2016-03-10 17:27:37
9 categories: writing
10 ---
11
12 Corrects 'inferior/superior than' to 'inferior/superior to'.
13
14 """
15 from proselint.tools import memoize, preferred_forms_check
16
17
18 @memoize
19 def check(text):
20 """Suggest the preferred forms."""
21 err = "misc.inferior_superior"
22 msg = "'Inferior' and 'superior' are not true comparatives. Use '{}'."
23
24 preferences = [
25 ["inferior to", ["inferior than"]],
26 ["superior to", ["superior than"]],
27 ]
28
29 return preferred_forms_check(text, preferences, err, msg)