Debian Codegraph @

proselint/checks/sexism/misc.py

raw
1 """Sexism.
2
3 ---
4 layout: post
5 source: Garner's Modern American Usage
6 source_url: http://bit.ly/1T4alrY
7 title: sexism
8 date: 2014-06-10 12:31:19
9 categories: writing
10 ---
11
12 Points out sexist language.
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 = "sexism.misc"
22 msg = "Gender bias. Use '{}' instead of '{}'."
23
24 sexism = [
25 ["anchor", ["anchorman", "anchorwoman"]],
26 ["chair", ["chairman", "chairwoman"]],
27 ["drafter", ["draftman", "draftwoman"]],
28 ["ombuds", ["ombudsman", "ombudswoman"]],
29 ["tribe member", ["tribesman", "tribeswoman"]],
30 ["police officer", ["policeman", "policewoman"]],
31 ["firefighter", ["fireman", "firewoman"]],
32 ["mail carrier", ["mailman", "mailwoman"]],
33 ["history", ["herstory"]],
34 ["women", ["womyn"]],
35 ["poet", ["poetess"]],
36 ["author", ["authoress"]],
37 ["waiter", ["waitress"]],
38 ["lawyer", ["lady lawyer"]],
39 ["doctor", ["woman doctor"]],
40 ["bookseller", ["female booksalesman"]],
41 ["air pilot", ["female airman"]],
42 ["executor", ["executrix"]],
43 ["prosecutor", ["prosecutrix"]],
44 ["testator", ["testatrix"]],
45 ["husband and wife", ["man and wife"]],
46 ["chairs", ["chairmen and chairs"]],
47 ["men and women", ["men and girls"]],
48 ["comedian", ["comedienne"]],
49 ["confidant", ["confidante"]],
50 ["scientist", ["woman scientist"]],
51 ["scientists", ["women scientists"]]
52 # ["hero", ["heroine"]]
53 ]
54
55 errors = preferred_forms_check(text, sexism, err, msg, ignore_case=False)
56
57 msg = "Not a preferred form. Use '{}' instead of '{}'."
58 pref = [
59 ["anchor", ["anchorperson"]],
60 ["chair", ["chairperson"]],
61 ["drafter", ["draftperson"]],
62 ["ombuds", ["ombudsperson"]],
63 ["tribe member", ["tribesperson"]],
64 ["police officer", ["policeperson"]],
65 ["firefighter", ["fireperson"]],
66 ["mail carrier", ["mailperson"]],
67 ]
68 for x in preferred_forms_check(text, pref, err, msg, ignore_case=False):
69 errors.append(x)
70
71 return errors