Debian Codegraph @

proselint/checks/misc/composition.py

raw
1 """Elementary Rules of Usage.
2
3 ---
4 layout: post
5 source: Strunk & White
6 source_url: ???
7 title: Elementary Principles of Composition
8 date: 2014-06-10 12:31:19
9 categories: writing
10 ---
11
12 Strunk & White say:
13 1. Choose a suitable design and hold to it.
14 * MDPNB: Sounds like a principle of `consistency`.
15 2. Make the paragraph the unit of composition.
16 * MDPNB: This can be generalized to say something about variability in the
17 length of paragraphs and sentences. When any device is too often used it
18 becomes a mannerism.
19 * MDPNB: Sounds like a principle of `variation`.
20 3. Use the active voice.
21 4. Put statements in positive form.
22 * MDPNB: In some cases this will apply as an invective against the use of
23 a double negative.
24 * Ex: He was not very often on time. -> He usually came late.
25 * Ex:
26 4.1. Placing negative and positive in opposition makes for a stronger
27 structure.
28 * Ex. Not charity, but simple justice.
29 * Not that I loved Caesar less, but that I loved Rome more.
30 4.2. Do not use unnecessary auxiliaries or conditionals.
31 5. Use definite, specific, concrete language.
32 * A period of unfavorable weather set in. ->It rained every day for a week.
33 6. Omit needless words.
34 * `The fact that` is particularly pernicious.
35 * `who is, which was` and the like are often superfluous
36 7. Avoid a succession of loose sentences.
37 * MDPNB Principle of brevity. Take 2.
38 8. Express coordinate ideas in similar form.
39 * MDPNB: Principle of parallel structure.
40 * MDPNB: This one will be hard...
41 9. Keep related words together.
42 * MDPNB: Principle of localism in semantics.
43 10. In summaries, keep to one tense.
44 * MDPNB: Principle of temporal consistency.
45 11. Place the emphatic word of a sentence at the end.
46 * MDPNB: Principle of recency.
47 """
48 from proselint.tools import memoize, preferred_forms_check
49
50
51 @memoize
52 def check(text):
53 """Suggest the preferred forms."""
54 err = "strunk_white.composition"
55 msg = "Try '{}' instead of '{}'."
56
57 bad_forms = [
58 # Put statements in positive form
59 ["dishonest", ["not honest"]],
60 ["trifling", ["not important"]],
61 ["forgot", ["did not remember"]],
62 ["ignored", ["did not pay (any )?attention to"]],
63 ["distrusted", ["did not have much confidence in"]],
64
65 # Omit needless words
66 ["whether", ["the question as to whether"]],
67 ["no doubt", ["there is no doubt but that"]],
68 ["used for fuel", ["used for fuel purposes"]],
69 ["he", ["he is a man who"]],
70 ["hastily", ["in a hasty manner"]],
71 ["this subject", ["this is a subject that"]],
72 ["Her story is strange.", ["Her story is a strange one."]],
73 ["because", ["the reason why is that"]],
74 ["because / since", ["owing to the fact that"]],
75 ["although / though", ["in spite of the fact that"]],
76 ["remind you / notify you",
77 ["call your attention to the fact that"]],
78 ["I did not know that / I was unaware that",
79 ["I was unaware of the fact that"]],
80 ["his failure", ["the fact that he had not succeeded"]],
81 ["my arrival", ["the fact that i had arrived"]]
82 ]
83
84 return preferred_forms_check(text, bad_forms, err, msg)