Debian Codegraph @

proselint/checks/misc/phrasal_adjectives.py

raw
1 """Phrasal adjectives.
2
3 ---
4 layout: post
5 source: Garner's Modern American Usage
6 source_url: http://bit.ly/1T4alrY
7 title: Phrasal adjectives
8 date: 2014-06-10 12:31:19
9 categories: writing
10 ---
11
12 Phrasal adjectives.
13
14 """
15 from proselint.tools import existence_check, memoize, preferred_forms_check
16
17
18 @memoize
19 def check_ly(text):
20 """Check the text."""
21 err = "garner.phrasal_adjectives.ly"
22 msg = """No hyphen is necessary in phrasal adjectives with an adverb
23 ending in -ly, unless the -ly adverb is part of a longer
24 phrase"""
25
26 regex = r"\s[^\s-]+ly-"
27
28 return existence_check(text, [regex], err, msg,
29 require_padding=False, offset=-1)
30
31
32 @memoize
33 def check(text):
34 """Check the text."""
35 err = "garner.phrasal_adjectives.examples"
36 msg = """Hyphenate '{1}', a phrasal adjective, as '{0}'."""
37
38 list = [
39 ["across-the-board discounts", ["across the board discounts"]],
40 ["acute-care treatment", ["acute care treatment"]],
41 ["agreed-upon answer", ["agreed upon answer"]],
42 ["big-ticket item", ["big ticket item"]],
43 ["class-action lawyer", ["class action lawyer"]],
44 ["criminal-law professor", ["criminal law professor"]],
45 ["cut-and-dried issue", ["cut and dried issue"]],
46 ["downward-sloping line", ["downward sloping line"]],
47 ["English-language learners", ["English language learners"]],
48 ["English-speaking people", ["English speaking people"]],
49 ["even-numbered", ["even numbered"]],
50 ["face-to-face meeting", ["fact to face meeting"]],
51 ["fixed-rate mortgage", ["fixed rate mortgage"]],
52 ["for-profit firm", ["for profit firm"]],
53 ["foreign-sounding name", ["foreign sounding name"]],
54 ["government-owned business", ["government owned business"]],
55 ["hard-and-fast issue", ["hard and fast issue"]],
56 ["head-on collision", ["head on collision"]],
57 ["head-to-head battle", ["head to head battle"]],
58 ["head-to-head competition", ["head to head competition"]],
59 ["health-care coverage", ["heath care coverage"]],
60 ["high-school student", ["high school student"]],
61 ["hit-and-run statute", ["hit and run statute"]],
62 ["HIV-negative person", ["HIV negative person"]],
63 ["HIV-positive person", ["HIV positive person"]],
64 ["information-technology personnel",
65 ["information technology personnel"]],
66 ["intellectual-property rights", ["intellectual property rights"]],
67 ["interest-group pressures", ["interest group pressures"]],
68 ["joint-stock company", ["joint stock company"]],
69 ["kidney-dialysis machine", ["kidney dialysis machine"]],
70 ["long-run costs", ["long run costs"]],
71 ["long-term care", ["long term care"]],
72 ["low-income housing", ["low income housing"]],
73 ["mom-and-pop retail outlet", ["mom and pop retail outlet"]],
74 ["mom-and-pop shop", ["mom and pop shop"]],
75 ["national-security briefing", ["national security briefing"]],
76 ["natural-gas pipeline", ["natural gas pipeline"]],
77 ["no-fault accident", ["no fault accident"]],
78 ["no-fault divorce", ["no fault divorce"]],
79 ["no-fault insurance", ["no fault insurance"]],
80 ["odd-numbered", ["odd numbered"]],
81 ["office-supply store", ["office supply store"]],
82 ["one-way flight", ["one way flight"]],
83 ["one-way window", ["one way window"]],
84 ["open-and-shut case", ["open and shut case"]],
85 ["open-and-shut issue", ["open and shut issue"]],
86 ["open-source community", ["open source community"]],
87 ["optical-scan ballot", ["optical scan ballot"]],
88 ["pension-fund investments", ["pension fund investments"]],
89 ["private-sector employment", ["private sector employment"]],
90 ["profit-seeking efforts", ["profit seeking efforts"]],
91 ["punch-card ballot", ["punch card ballot"]],
92 ["quality-adjusted price", ["quality adjusted price"]],
93 ["razor-sharp intellect", ["razor sharp intellect"]],
94 ["razor-sharp mind", ["razor sharp mind"]],
95 ["razor-sharp mind", ["razor sharp mind"]],
96 ["razor-sharp wit", ["razor sharp wit"]],
97 ["larger-than-life personality", ["larger than life personality"]],
98 ["real-estate prices", ["real estate prices"]],
99 ["real-estate tycoon", ["real estate tycoon"]],
100 ["right-wing militia", ["right wing militia"]],
101 ["round-trip flight", ["round trip flight"]],
102 ["search-and-rescue operation", ["search and rescue operation"]],
103 ["second-largest army", ["second largest army"]],
104 ["shell-shocked mothers", ["shell shocked mothers"]],
105 ["shell-shocked soldiers", ["shell shocked soldiers"]],
106 ["small-business loan", ["small business loan"]],
107 ["small-business owner", ["small business owner"]],
108 ["small-state senator", ["small state senator"]],
109 ["small-animal veterinarian", ["small animal veterinarian"]],
110 ["state-sponsored terrorism", ["state sponsored terrorism"]],
111 ["state-sponsored violence", ["state sponsored violence"]],
112 ["thumbs-up sign", ["thumbs up sign"]],
113 ["time-honored tradition", ["time honored tradition"]],
114 ["U.S.-led campaign", ["U.S. led campaign"]],
115 ["upward-sloping line", ["upward sloping line"]],
116 ["venture-backed company", ["venture backed company"]],
117 ["well-publicized event", ["well publicized event"]],
118 ["wire-transfer service", ["wire transfer service"]],
119 ["yes-or-no question", ["yes or no question"]],
120 ["zero-sum game", ["zero sum game"]],
121 ["stained-glass ceiling", ["stained glass ceiling"]],
122 ["stained-glass window", ["stained glass window"]],
123 ["free-range chicken", ["free range chicken"]],
124 ["free-range poultry", ["free range poultry"]],
125 ["non-profit-making organization",
126 ["non profit making organization",
127 "non-profit making organization",
128 "non profit-making organization"]],
129
130
131 # Harmony
132 ["three-part harmony", ["three part harmony"]],
133 ["four-part harmony", ["four part harmony"]],
134 ["six-part harmony", ["six part harmony"]],
135 ["eight-part harmony", ["eight part harmony"]],
136
137 # Losses and gains.
138 ["first-quarter loss", ["first quarter loss"]],
139 ["second-quarter loss", ["second quarter loss"]],
140 ["third-quarter loss", ["third quarter loss"]],
141 ["fourth-quarter loss", ["fourth quarter loss"]],
142 ["first-quarter gain", ["first quarter gain"]],
143 ["second-quarter gain", ["second quarter gain"]],
144 ["third-quarter gain", ["third quarter gain"]],
145 ["fourth-quarter gain", ["fourth quarter gain"]],
146
147 ]
148
149 return preferred_forms_check(text, list, err, msg)